Understanding the Differences Between Serverless and Non-Serverless NoSQL Databases: Pros, Cons, and Use Cases
Uriel Bitton
AWS Cloud Engineer | The DynamoDB guy | AWS Certified | I help you supercharge your DynamoDB database ????
?? Hello there! Welcome to The Serverless Spotlight!
In this week's edition, I'll explain the subtle differences between a serverless NoSQL database and its non-serverless counterpart. I'll also lay out the pros and cons for each and recommend when to use which.
A constant concern for backend developers today is choosing between serverless and traditional services.
Serverless functions (Lambda) vs traditional server instances (EC2).
Serverless storage (S3) vs block storage (EBS).
Serverless container computing (Fargate) vs traditional container orchestration (ECS).
Serverless messaging queues (SQS) vs traditional message brokers (RabbitMQ).
Serverless databases (DynamoDB) vs traditional NoSQL databases (MongoDB).
The last one is the concern of this article.
What Is A Serverless Database?
A serverless database NoSQL is a cloud-native database system where the infrastructure and operational tasks of backups, maintenance, and server patching (updates), are fully managed by the cloud provider.
Another principle element of a serverless database is that scaling is usually fully or partially managed by the database system.
In the case of DynamoDB, scaling high does not take more effort from the user than proper key design. Complex tasks like data replication, sharding and horizontal scaling of your database is handled automatically for you.
With a serverless database, you can automatically scale based on demand and be charged only for the capacity you use and nothing more (contrary to non-serverless databases).
This makes serverless databases highly cost-effective for various workloads (when used correctly).
Key features of a serverless database
Some key features of a serverless database include:
What is a non-serverless database?
A non-serverless database is a database where the developer is responsible for provisioning, managing, and maintaining the underlying database infrastructure.
You need to update the system when necessary, manually backup data, and scale it up or down yourself.
While you get more fine-grained control of the database system, this brings in more complexities - complexities that are oftentimes not necessary for most to most users to be responsible for.
The bottom line here is to understand your needs well and carefully consider when you need to be able to configure the underlying servers and scaling capabilities and when you don't need to.
Pros and Cons of Serverless Databases
Additional benefits of serverless databases include being able to get to market quicker. Being able to focus more on the data lets you build faster.
The fact that they are more cost-effective lends an edge to your business goals.
领英推荐
Some cons include:
Pros and Cons of non-serverless Databases
Some pros of non-serverless databases include:
The cons:
Use Cases for either database types
What are some great use cases for serverless databases?
I've worked with many databases in production, both serverless and non-serverless types. Here are my recommendations based on both good practices and experience:
What are some good use cases for non-serverless databases?
Conclusion
Both serverless and non-serverless databases offer their benefits.
Like most things, the decision to use one or the other often lies in the use case of the application.
Serverless databases are advantageous in environments where scalability and cost-efficiency are critical, especially for variable workloads or small teams.
On the other hand, non-serverless databases provide more control, consistency, and predictability, making them ideal for large-scale enterprise applications or those with strict compliance needs.
?? My name is Uriel Bitton and I hope you learned something in this edition of The Serverless Spotlight
?? You can share the article with your network to help others learn as well.
?? If you want to learn how to save money in the cloud you can subscribe to my brand new newsletter The Cloud Economist.
?? I hope to see you in next week's edition!
References