DEV Community

Discussion on: What is your favorite database?

Collapse
patarapolw profile image
Pacharapol Withayasakpunt

How cheap it MySQL / MariaDB; compared to MongoDB Atlas - like, how many rows / database size?

Collapse
joelbonetr profile image
JoelBonetR • Edited on

LoL... you install MySQL or MariaDB or Postgres in a VM instance for free (just linux regular apt install commands), you configure it and that's all, free for you forever. The DB size limit? your VM instance's disk space. If you picked 20Gb so the limit is 20Gb unless you scale this resource.

In other words, you don't need to "trust" the google results. You need to trust in you, at the end you are the one configuring it and making it up and running 😆

For instance, it's exactly the same that I would do with Mongo. Using Mongo from Atlas is just a convenience for learners but as you can see, it makes you dash apart the step of setting up a DB Server so you ended up thinking that effectively you need a provider for that.

docs.mongodb.com/manual/administra...
postgresql.org/

And so on. Think that for the provider being able to currently provide you with a DB Service, those database servers were installed on this provider servers in the first hand.

To sum up, the cost is the VM instance one (or a kubernetes pod or a shared hosting or a VPS or... whatever you use to set it up).

If you choose the cheapest, you can pick a web shared hosting like this one (Hosting -> web hosting) for few dollars a month and you can set up both PHP and Node webApps here along with MySQL databases on a super easy way as the environment is closed and configured already, you just interact with a CPanel to get the things done (and the support guys are glad to help you at any time).

You can also choose Servers -> VPS Servers, it's a bit more expensive and a bit more complicated as it's self managed , meaning you need to manage your instance, so you can install a mongo server on it if you want (there's also the option of paying a bit more for them IT guys to manage it for you, so you simply ask them what you want).

VPS stands for Virtual Private Server and it's more or less the same than a VM instance on Google Cloud Platform, Amazon Web Services or Azure (despite architectural and scalability concepts related to distributed systems that I don't want qualifies for a full post).
You can also get a Servers -> Dedicated Servers for a bigger price and here you are renting a full server (the entire machine itself, managed remotely) so you can put all resources together or virtualize them or... whatever you want.

Thread Thread
patarapolw profile image
Pacharapol Withayasakpunt

VM instances aren't free.

Thread Thread
joelbonetr profile image
JoelBonetR

Updated the previous comment with extra information about that.
Of course, none is for free at all in this life, in Atlas or any provider, with a free account, the priority is set for paid users first, so when the network is jammed, you're the first to loose the service so they can continue providing quality service to paid users.
They use a candy model in which you get something "for free" with no minimum availability by contract and then, if your App scales, you'll end up paying more than the cost of setting it up yourself as I've said.

To set up a reliable webApp you need to host your frontend, your backend and your Database.

The database can be a filesystem based one like SQLite 3 for example so you ship it along your backend and you can set up both front + back in the same environment.

The easiest way to set it up is on a monolith, for example, using Next js as backend server/middleware/proxy and React inside Next js for the frontend along with SQLite or MySQL in a shared hosting like the one I linked above, it's just less than 5 bucks a month and you get your own instance and your service up and running.

The good think with this hosting model is that you can set up multiple webapps in the same shared hosting even with different domains, and if you need to scale it, you can migrate the entire shared hosting or just the apps you want to an VPS to ensure better service for your customers.