The EDB Blog
April 26, 2019

The Benefits of Databases in Containers

Highly available databases allow organizations to run database operations around-the-clock, providing consistent and reliable access to database-dependent applications and services. When databases are placed in containers, they can be deployed very fast, and multiple databases can be run simultaneously and securely on private clouds, public clouds, or virtual machines that are highly scalable and easy to manage, resulting in reduced infrastructure cost.

Postgres, one of the world’s most trusted open-source relational database solutions, works seamlessly with containerization technology for organizations of any size. As a leading contributor to the open-source PostgreSQL project, we offer a comprehensive suite of tools through the EDB Postgres Platform to support running highly available Postgres databases in containers. The result is a stable, scalable database that can be adapted to meet the changing needs of any large-scale organization.

Containers are originally designed for running stateless or ephemeral applications where there is no need to retain state information of the application past the container’s lifetime. Consequently, containers can support a fungible model, where multiple instances of the same container are indistinguishable from each other, and one instance can be replaced at any time with another without any adverse effect. Furthermore, deploying, scaling up or scaling down become trivial operations.

Operating Highly Available Postgres Containers

However, when databases are run in containers, it violates the original premise of containers since databases are inherently stateful applications, and therefore, neither ephemeral nor fungible. Each instance of the container is distinct from the other by virtue of the contents of its data store, which has to be preserved past its lifetime. Consequently, extra care must be taken to preserve the data just as well as during deployment and scaling to ensure the container is operating correctly.

Understanding these distinctions is crucial to operating highly available Postgres containers. To achieve high availability, Postgres containers have to employ a combination of different methods, such as automatic failover, streaming replication, query routing, and load balancing. Implementing high availability manually using custom scripting would require significant effort, if at all possible.

The EDB Container Platform

EDB Container Platform takes advantage of tools in its repository to achieve high availability in Postgres containers:

  • The database container embeds the EDB Failover Manager along with the Postgres database server to provide failover capability.
  • For read scalability, the pgPool container provides query routing and load balancing.
  • Although not directly related to high availability, the following containers have significant supporting roles:
    • For monitoring and management, the Postgres Enterprise Manager container provides database-specific tools with functional equivalency to Oracle Enterprise Manager.
    • The backup and recovery container provides point-in-time recovery, and — for larger databases — the ability to do incremental backups in addition to normal backup/recovery functions.
    • Finally, you have a tool container that makes it possible to migrate from older versions of advanced servers.

Through greater control and a better understanding of how your Postgres containers function, your databases will be able to act as miniservices or microservices, allowing your database needs to scale or change as required. The result is a database platform that’s available around-the-clock, providing the reliability and stability enterprise clients depend upon.

Containers for Database Development

Today, containers are quickly becoming a key platform for database development, but are also being used in production deployments and other large-scale projects. While containerization is a relatively young technology, best practices are beginning to emerge as companies get a better grasp of the database capabilities offered by containers. As organizations continue to reap the benefits of containerized Postgres environments, EDB Container Platform is poised to become a major production deployment platform by 2020.

Since 2004, EDB’s enterprise database experts have been trusted by more than 4,000 customers around the globe. As a leading developer of the Postgres project, EDB’s database container solutions are purpose-built for large-scale organizations that require high availability and reliability. Through the EDB Container Platform, companies will be able to deploy highly available databases at scale, backed up by decades of Postgres development expertise.


azizrahman's picture

Aziz Rahman is the Lead Architect for the EDB Container Platform at EnterpriseDB, the foremost vendor of the open source database, Postgres.  He has been working extensively with Docker and Kubernetes for the past several years and is responsible for delivering a containerized Postgres ecosystem...