RDBMS vs. NoSQL: What’s the difference?
RDBMS strengths and weaknesses
- ACID guarantees ACID guarantees ensure that database transactions will either succeed or fail in an expected way. Relational databases provide ACID guarantees for each database transaction, which makes them ideal for data that needs to be reliably recorded, like financial transactions, inventory logs, catalogs, and other essential business data.
- Vertical scalability Vertical scaling (scaling-up) refers to adding more compute resources like CPUs and memory to your database server to increase your application traffic. Since relational databases have monolithic architectures, they are designed to run on a single server. Adding more hardware capacity to the server at hand makes it possible to scale vertically without requiring any changes to the application code.
- Lack of flexibility A relational database works well when the application has attributes predefined based on the schema — storing data in two-dimensional tables with rows and columns. However, if the application schema changes frequently, the relational database may not be flexible enough to meet these dynamically evolving application requirements.
- Scale limits Not only does vertical scaling increase hardware costs, but it also has an upper limit on the hardware capacity (maximum CPU cores, maximum RAM), beyond which you cannot scale. Further, the servers need to be taken down for upgrading hardware, impacting the availability of mission-critical applications.
When are NoSQL databases a better choice?
- Agility in development Instead of getting bogged down by defining a schema upfront, developers can work with loosely defined datasets and change them later as per the feature iterations. In addition, NoSQL databases can store data in JSON document format, allowing developers to easily read and write data and integrate it with modern web applications. This can improve agility in the overall software development cycle.
- Horizontal scalability Scaling out horizontally means increasing server resources to handle the traffic. To achieve this, teams can add servers and shard the data — that is, divide the data into subsets and distribute them among different servers. With a NoSQL database, horizontal scaling is typically less expensive since the data is already packed in self-contained objects, making it easier to migrate to other servers.
- Not ACID-compliant While NoSQL databases are well designed to scale horizontally, it provides that scalability at the expense of reliability. NoSQL databases cannot guarantee ACID transactions without adding significant overhead to the database cluster.
- Complexity in scaling When multiple servers are involved, sharding a database becomes a complex process. With every new node added to the database cluster, the complexity increases — you will need to configure the load balancer to be aware of this new server, tune network communication, and put in additional monitoring stacks and tools like Grafana and Apache Zookeeper. Indeed, all of this is needed when you have a large dataset, but it may not be worth the effort when the dataset is small.
Get the flexibility of NoSQL with the reliability of an RDBMS
Sign-up for free
Quick start guide
If you enjoyed our blog, and want to work on systems and challenges related to globally distributed systems, serverless databases, GraphQL, and Jamstack, Fauna is hiring!
Subscribe to Fauna blogs & newsletter
Get latest blog posts, development tips & tricks, and latest learning material delivered right to your inbox.