What is a managed database service

What do developers want from a database? In the cloud-native era, developers want a database to be reliable, scalable, and logically act as a single entity regardless of the number of instances. For many businesses, managing a database is not their core strength, and neither it is their competitive advantage. A managed database provides all these features (and more) so that developers can focus on developing their business-critical applications.

In this article, I discuss the true costs and benefits of self-hosting and managing a database. At the end, you can find five questions to ask yourself when moving from a self-managed to a managed database service.

Cost of hosting and managing databases

From a cost perspective, consider these three factors for managing a database:

1. Hardware costs: When hosting a database, you typically have either physical or virtual machines (running Linux). This hardware costs money. In the case of physical hardware, you also have to foot the costs of the physical setup, networking, and security (you don’t want someone to run away with a disk, right?).

2. Software costs: The license of your database software costs money. If you’re using open-souce software (good choice BTW), you avoid licensing fees but you need experienced DBAs and engineers to make the open-source software work for your business. More on this below…

3. Operational costs: Operational costs are costs to run your database smoothly on a day-to-day basis. You’ll need a team of DBAs and/or SREs to configure and monitor these databases. The cost of technical talent is the biggest chunk of the operational costs. Besides running the main database, for production databases, you probably have some disaster recovery plans. There are costs associated with creating backups (cost of storage), as well as the cost of technical talent who spends time on the database backup rather than working on your business applications. Also, both operating system and databases must be updated, and incur costs for a zero downtime setup.

A self-hosted and self-managed option can make sense for large engineering teams with deep expertise in databases, or for businesses that need custom solutions for their database needs. It gives the owner more control.

Benefits of managed databases

If yours isn’t a large enterprise, though, managed options are usually more feasible. Let’s take a look at some of the benefits.

Hassle-free administration

The first benefit of a managed database is that you don’t have to administer either the operating system of the host machine or the database itself. Security patches and updates for the operating system and database can get time-consuming and a managed database provider runs this maintenance for you in the background. Your data is encrypted at rest and in transit with most managed database providers.

Scalability

Whether you need to scale up or scale out, you can do so with the click of a button or a CLI command rather than buying expensive hardware. In the case of self-hosted database on a virtual machine, you would most likely need to take the database instance down before adding more compute power. In the case of managed database, you can respond to increased load with a more powerful machine or increased number of database instances. Often times, your managed database service will not be impacted during this migration.

Performance

A managed database provider will fine-tune the database to drive optimal performance. Unless you have database experts in your team, you will have difficulties to turn the knobs to get peak database performance. Furthermore, with cloud/managed database services, you’ll have the option to choose from HDD or SSD based on your estimated IOPS. If you own the servers yourself, you’re stuck with the choice of storage.

Monitoring

Logs and metrics for your databases are provided out-of-the-box for a managed database service which you don’t have to pay for. On the other hand, you would have to write custom integrations for your self-hosted database.

Cost

Cloud and managed database services are billed by the hour (or even minutes in some cases). That means that you only pay for your usage and don’t pay for idle server hours.

Moving from a self-managed to a managed database service - five factors to consider

Perhaps you’re now convinced that managed database is a better option, and you’re ready to pull the trigger on your on-prem database. But slow down! Database migration is a complex process. Not only you need to ensure that the data is replicated correctly, you also need to minimize downtimes for your critical applications.

Here are five factors to consider for your big move:

  1. Is it a homogeneous (same source and target database) or heterogeneous (different source and target database) migration?
  2. Is downtime of the source database an option, or you would need the source database to remain fully operational during the migration?
  3. If the state of the target database is not the same as the source database post migration, have you considered the time and effort needed to make application code changes?
  4. There might be different database migration tools available for your database. What is the level of maturity and the amount of support provided for a given tool?
  5. How does the preferred tool handle data security during the migration process? How do you safely destroy the data from the previous database?

You can take a look at Aiven DB Migrate - an open-source tool for easy migration of databases from some database service provider, such AWS RDS, or on premises data center, to Aiven. However, it’s not limited for Aiven services and it might be useful as a generic database migration tool.

Wrapping up

This post discussed the value of a managed database service over managing the database yourself. If you’re ready to move to a different provider (hopefully Aiven :D), I provided some factors to consider for a secure and effective migration.

And if you have gone through the database migration process and would like to share some tips, please let us know.