Book Image

PostgreSQL 12 High Availability Cookbook - Third Edition

By : Shaun Thomas
Book Image

PostgreSQL 12 High Availability Cookbook - Third Edition

By: Shaun Thomas

Overview of this book

Databases are nothing without the data they store. In the event of an outage or technical catastrophe, immediate recovery is essential. This updated edition ensures that you will learn the important concepts related to node architecture design, as well as techniques such as using repmgr for failover automation. From cluster layout and hardware selection to software stacks and horizontal scalability, this PostgreSQL cookbook will help you build a PostgreSQL cluster that will survive crashes, resist data corruption, and grow smoothly with customer demand. You’ll start by understanding how to plan a PostgreSQL database architecture that is resistant to outages and scalable, as it is the scaffolding on which everything rests. With the bedrock established, you'll cover the topics that PostgreSQL database administrators need to know to manage a highly available cluster. This includes configuration, troubleshooting, monitoring and alerting, backups through proxies, failover automation, and other considerations that are essential for a healthy PostgreSQL cluster. Later, you’ll learn to use multi-master replication to maximize server availability. Later chapters will guide you through managing major version upgrades without downtime. By the end of this book, you’ll have learned how to build an efficient and adaptive PostgreSQL 12 database cluster.
Table of Contents (17 chapters)

What this book covers

Chapter 1, Architectural Considerations, explains how the layout of the nodes in our PostgreSQL cluster can drastically influence its availability.

Chapter 2, Hardware Planning, explains the selection and provisioning of hardware required to build a highly available PostgreSQL database.

Chapter 3, Minimizing Downtime, explains how we should react when outages inevitably occur and how to prepare ourselves for them.

Chapter 4, Proxy and Pooling Resources, explains how to combine and abstract connectivity to isolate and protect the database.

Chapter 5, Troubleshooting, covers several techniques to track sources of poor performance or stop potential outages before they occur.

Chapter 6, Monitoring, focuses on what we should monitor, how often we should check system status, and how to present the data for easy consumption. We will learn how to effectively monitor PostgreSQL's server status and database performance.

Chapter 7, PostgreSQL Replication, shows how to utilize PostgreSQL replication as well as third-party table synchronization tools. We will learn several methods to copy entire databases or individual tables.

Chapter 8, Backup Management, shows where to turn when backing up large PostgreSQL clusters becomes a concern. This chapter will help ensure backups not only fulfill their stated role but are also reliable, fast, and efficient.

Chapter 9, High Availability with repmgr, discusses all the capabilities so that we can construct a fully automated high-availability stack. This chapter is dedicated to building a fully automated high-availability stack using the repmgr replica and cluster management tools by 2ndQuadrant.

Chapter 10, High Availability with Patroni, explains how to build a quick, yet adaptable, high-availability stack to keep our PostgreSQL servers online.

Chapter 11, Low-Level Server Mirroring, shows how to build and manipulate a fault-tolerant, high-performance foundation for our PostgreSQL clusters.

Chapter 12, High Availability via Pacemaker, shows how to automate cluster management and ensure high availability. This chapter covers Corosync and Pacemaker and the steps to manage dual-node servers with this software.

Chapter 13, High Availability with Multi-Master Replication, explains how multiple writable PostgreSQL nodes affect the concept of high availability. This chapter explores the inherent limitations of multi-master database technology as applied to PostgreSQL, as well as how to best utilize it to maximize application availability.

Chapter 14, Data Distribution, shows how clever data management can increase uptime even further.

Chapter 15, Zero Downtime Upgrades, explains how to upgrade a cluster while remaining fully online.