DEV Community

Discussion on: What Database to use?

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.