CockroachDB Glossary

Serverless Database

What is a serverless database?

A serverless database is any database that embodies the core principles of the serverless computing paradigm. Those core serverless principles are:

  • Little to no manual server management
  • Automatic, elastic app/service scale 
  • Built-in resilience and inherently fault tolerant service
  • Always available and instant access
  • Consumption-based rating or billing mechanism

For developers, what’s important to note is that a serverless database abstracts away most of the complexity into a simple API in the cloud. In a serverless database developers should expect scale, resilience, and transactional consistency to be accomplished without much operational overhead.Perhaps most importantly, with a serverless database you pay only for what you use. And most serverless databases are free up to a certain amount of storage (Example: 5GB).

This video explains serverless databases in less than 3 minutes:

Which databases are serverless?

While the term serveless has a specific definition, it is not well understood, and the term is used generously by marketing teams in the industry. Because of this trend it’s difficult to narrow down which databases are truly serverless. This is the current list:

For starters, any serverless application will run better on a serverless database. This does not mean that serverless applications need to run on a serverless database. It’s just that running a serverless application on a serverless database allows you to take full advantage of being distributed. 

There are relational serverless databases and eventually consistent Serverless databases so the use cases will vary depending on whether you want the transactional consistency that you get from a relational database. Also, each of the serverless databases listed above has different strengths and weaknesses. Some have instantaneous starts while most others have cold starts. Some have single write node limitations, or unfamiliar SQL language variations, or high latencies…So you’ll have to research each before deciding which is best for your use case. In general, a serverless database is adopted for these two reasons: 

  1. Serverless databases abstract operational tasks
  2. Serverless databases simplify the costs of the cloud (aka, pay for what you use)

Here are some situations in which a serverless database is a good fit today:

Side project - Don’t spend money upfront and if the app is successful, monitor & control your spending throughout. 

Proof/Starter Project - build out a simple proof of concept for an application idea without paying for a platform in order to confirm that the database is the right fit before spending any money.

Development environments - prototype a new use case on a serverless database. This type of dev environment is great for quick tests or to try out features. 

Continuous integration (CI) pipelines - create a testing environment for your development teams so they don’t have to think about choosing, sizing, etc. the machines. They can just write code and run queries, and automate all of this.

Evaluation - users that would like to understand how a database works before committing to paying for a cluster. Users who want to test out certain features or begin prototyping their application before paying.

Also, serverless databases can provide additional benefits if your project/application has:

  • Spiky transactions - applications that have unpredictable high and low traffic depending on the time of day, year, month, etc. (i.e. a social media app that sees spikes on weekends. A financial news site that sees spikes twice a day when markets open and close. A retail site that sees spikes during Black Friday or the holidays.) Or applications that might have unpredictable spikes in traffic. (i.e. A breaking news website. A gaming workload when a game suddenly goes viral.)
  • Budget caps - a project has a limited budget, but potential for scale. Test out the application first and manage your budget through its development. 
  • Limited manpower dedicated to the project - only a small group of engineers are assigned to work on this project, but still would like to see it be successful
  • Immediate delivery - an application that needs to be delivered, fast. Quickly build on a serverless database and make updates while in production.