EventJoin us at AWS re:Invent 2024! Learn how to use MongoDB for AI use cases. Learn more >>

Serverless Databases Explained

Modern application development has evolved over the years — from monolithic application and database servers to distributed systems, and now to the concept of serverless. Applications are becoming more performant and reliable, and the process to develop them is becoming easier. So what is serverless and what is the relationship between serverless applications and serverless databases?

The concept of serverless does not mean that there are no servers involved. Serverless means that the developer won’t need to manage the servers both for configuration and in scaling. This article will explore more on the topic so you feel comfortable as a developer.

What does serverless mean?

Like previously mentioned, serverless does not mean the absence of servers. There are still servers involved, contrary to what the name suggests. Instead, with serverless you can build and run applications without worrying about the underlying servers and infrastructure. With serverless, the developer has resources on demand and won’t have to burden themselves with scaling that could be time-consuming on pre-provisioned servers.

Serverless is not limited to applications. The concept of serverless carries to databases such as MongoDB Atlas, as well.

Advantages of a serverless database

There are many advantages to using a serverless database in your development stack. Some key advantages include, but are not limited to, the following:

  • Serverless databases leverage consumption-based pricing. In other words, pay for the resources that are used rather than the size of the pre-provisioned cluster.
  • Developers can focus on their data rather than their databases.
  • The burden of having to monitor database load or capacity and take action is removed due to the elastic scaling nature of a serverless database.

The advantages of a serverless database are similar to those of a serverless application and benefit greatly when used in combination.

Why you should use a serverless database

There are many reasons why you should use a serverless database, but a few that might resonate the most could be cost related or related to skills and resources within the organization.

Let’s say that your organization is short-staffed and you don’t have the resources or skills within the organization to monitor and manage database infrastructure. With a serverless database, no one within the organization needs to worry about that excessive amount of traffic you might receive that requires scaling or monitoring of the database. No one needs to bring your database down so you can upgrade the hardware. Instead, the staff you have can focus on the data and development, not the servers.

Worried about paying for a pre-provisioned database that is oversized or running into negative performance problems from a database that is undersized? You’re not paying a flat rate for a serverless database; you’re paying for what you use. So if you’re expecting burst amounts of throughput, you’re not going to pay for something potentially oversized and you’re not going to worry about scaling back down when the burst ends.

The different types of serverless databases

There are a few different types of serverless databases just like there are a few different types of databases in general.

We can break these serverless databases into two main categories: relational databases and non-relational (NoSQL) databases.

Popular serverless relational databases include the following:

  • Azure SQL
  • AWS Aurora
  • CockroachDB

For those looking for a non-relational option and who are more comfortable with key-value stores, document databases, and similar, the following are popular serverless non-relational databases:

  • MongoDB Atlas
  • AWS DynamoDB
  • Google Firestore

A good rule of thumb is to figure out the problem you need to solve and then figure out which database will best solve that problem. Serverless or not, pick a relational or non-relational database that will be best for you.

Summary

Serverless databases, like their serverless application counterpart, are quite valuable when it comes to modern development and production deployments. There are many different types of serverless databases — some relational, some non-relational — but they all aim to solve a similar set of problems: scaling on demand without a management burden, and reducing costs by paying for what you’re using.