DEV Community

Diogo Ribeiro
Diogo Ribeiro

Posted on

What Database to use?

What you guys' think is the best type of database ( Mysql,postgresql,mongodb... ) And provider ( aws, azure, supabase... ) for a Saas?

Latest comments (15)

Collapse
 
ilteriskeskin profile image
Ali İlteriş Keskin

We use main database MongoDB side database postgresql and mysql. Project deployed on the aws. We are heybooster! 😍

Collapse
 
thejuju profile image
Julien Gabriel

I'm so bored with that kind of question...
You should absolutely know that every type of database has its own scope of use. There is no "best" type of database.
It depends on several criteria that you do not expose on you topic :

  • estimated size
  • estimated amount of entries at the beginning and also in a close future
  • type of data you'd like to store
  • anonymization needed
  • your budget
  • licensing constraint
Collapse
 
limavit profile image
limavit

Oracle

Collapse
 
behrjozef profile image
Jozef Behr

I use mysql..

Collapse
 
wjplatformer profile image
Wj

unless you want security. 🤣

Collapse
 
aisuperhub profile image
AISuperHub

If you need relational data, MySQL and Postgres are the best bet. From a developer standpoint, here is a comparison between postgres vs mysql .

If its NoSQL and you can self manage instances,
MongoDB is definitely a good option. AWS even offers managed Mongodb.

Regarding AWS, Azure it highly depends on your tech stack and cost you currently have.

Collapse
 
joelbonetr profile image
JoelBonetR 🥇 • Edited

It depends on your SaaS needs.

To put it straightforward, Relational databases are efficient at processing queries and joining data across tables, making it easier to perform complex queries against structured data, including ad hoc requests. Non-Relational databases lack consistency across products and typically require more work to query data, particular as query complexity increases.

Relational databases

Offer many important features that make them aptly suited to enterprise workloads, which is why organizations have been turning to them for so long. They’re optimized for handling highly structured data, and their inherent characteristics -such as normalization, atomicity, and consistency- ensure the integrity of that data throughout its lifespan. These features also contribute to better storage utilization, while providing flexible query support through standards-based SQL.

Non-relational databases

There are different types of non-relational DBs

  • Key-value databases. Data is stored in a key-value structure that associates unique identifiers with specific data blobs, making it possible to store just about any type of data in whatever form it’s delivered. Example products include Redis, Berkeley DB, and Amazon DynamoDB.
  • Document databases. Data is stored as documents in a format such as JSON or XML, with each document assigned its own unique key, but without being limited to predefined fields or elements. Example products include MongoDB, CouchDB, and BaseX.
  • Column-oriented databases. Data is stored as strongly-typed columns rather than rows, making it possible to query and aggregate large volumes of data very quickly. These types of databases go by other names as well, such as column-store, wide-column store, and column-family. Example products include HBase, Bigtable, and Cloudera.
  • Graph databases. Data is stored in graph structures that define how the data is interconnected, essentially treating the relationships between the data as important as the data itself. Product examples include Neo4J, and InfiniteGraph.

If it was me I'd probably use PostgreSQL stored in a cheap VPS to begin with.
If you need to scale the DB there's always options to scale your VPS instance resources (vCores, RAM, disk space) and if needed, you can either distribute your DB through different VPSs or migrate to a cloud platform in a future.

Collapse
 
bias profile image
Tobias Nickel

For node.js I devekoped trdb. it is a db in a single json file. I estimate it is good for the first 10000 records.

Then the api is designed in a way, that it can be easily replaced with mongo or sql databases, without to much code changes.

I developed it after using json-server for a few personal projects. because: while json server is good for prototyping frontend applications and with trdb I wanted to target backend developers backend, to get prohects started quickly and be sure, that the applucations can change to real databases once needed.

trdb, similar as json-server want you get started with your projects, because I believe, most projects fail, because they never got started.

Collapse
 
bias profile image
Tobias Nickel

what about pocketbase.

it is a headless cms and realtime database. Backed by golang and sqlite in single process mode, you can serve 10 000 concurrent users from any cheap 6$ vps. Once your app outgrow this db, you likely have the money and the knowledge what bigger scaling database will be the best choice.

Collapse
 
eric23 profile image
Eric

HarperDB is a good option. SQL/NoSQL.