PostgreSQL High Availability in Practice cover

PostgreSQL High Availability in Practice

Rating 4.0
Word count
77K words
Chapters
52
ISBN
9787121430381

Tags

Summary

This practice-oriented book explains how to use PostgreSQL clusters and mainstream high-availability technologies—repmgr, Patroni, BDR multi-master replication, and others—in real environments, revealing PostgreSQL's technical strengths in reliability and high availability. It also covers backup and connection-pooling tools such as pg_probackup, pgBackReset, pg_rman, PgBouncer, and Odyssey.

True to its principle that technology comes from practice and returns to practice, the book follows a hands-on thread that connects PostgreSQL's mainstream high-availability technologies, with explanations of the underlying principles.

It is intended for technical managers, architects, database administration engineers, and technology enthusiasts working with databases.

Editor's review

This is a hands-on PostgreSQL high-availability book built around implementation. Rather than merely listing concepts, it walks through mainstream solutions such as repmgr, Patroni, and BDR multi-master replication in real cluster environments, and adds the use of backup and connection-pooling tools including pg_probackup, pg_rman, PgBouncer, and Odyssey, forming a complete chain from high-availability architecture to day-to-day operations. The author holds to the principle that technology comes from practice and returns to practice: each type of technology is presented first with an operational path, then tied together with principles, so readers can both get clusters running and understand why they are designed that way. The scenarios reflect common production needs—disaster recovery, failover, backup and restore, and connection management—making the book suitable as an advanced guide for DBAs moving from single instances to cluster operations, and for architects comparing the boundaries of different solutions during selection. Readers are advised to reproduce the steps in a test environment as they read, actually running through the commands, configurations, and failover procedures; the payoff will be far greater than reading alone.

Who it's for

A good fit for

  • DBAs with PostgreSQL fundamentals who want a systematic grasp of cluster high-availability solutions
  • Database architects selecting disaster recovery, backup, and connection-pooling options for production databases
  • Technical managers and operations leads who need to understand how database high availability is implemented
  • Technology enthusiasts with Linux and database basics who want to advance through hands-on experiments

Not a good fit for

  • Readers with no PostgreSQL or Linux basics who first need introductory syntax
  • Readers who only want high-availability concepts and do not intend to build and debug clusters
  • Practitioners who mainly use MySQL or other databases and have no short-term migration needs

Reading tips

  1. Read the high-availability principles chapters first, then build a repmgr or Patroni cluster in a test environment in the book's order, taking notes as you go.
  2. Make the backup and connection-pooling tools a separate round of experiments, focusing on verifying recovery procedures and business behavior during connection failover.
  3. When reaching BDR multi-master replication, compile a selection comparison table against single-master solutions, noting applicable scenarios and operational costs.
  4. After each experiment, record fault injection and failover results to build your own high-availability checklist.

About the publisher

Publishing House of Electronics Industry China · Founded in 1982

The Publishing House of Electronics Industry is a comprehensive publisher distinguished by its focus on electronic information and related fields. Judging from the more than 3,000 titles in its catalogue, its publishing covers programming and design, artificial intelligence, computer science, finance and economics, photography, and social sciences, attending both to cutting-edge technology and to general readers. Representative titles include Factor Investing: Methods and Practice, x86 Assembly Language: From Real Mode to Protected Mode, The RISC-V Reader, Artificial Intelligence: Speech Recognition, Understanding and Practice, Phased Array Radar Technology, Radar Target Characteristics, and 100 Go Mistakes and How to Avoid Them, most of which centre on technical methods and engineering practice. Its authors include Shi Chuan, Li Zhong, Wang Xiaobo, David Patterson, Andrew Waterman, and Yu Zihao, among others from China and abroad. Owing to limited public information, no further publishing features are elaborated here.

Contents

  1. 版权信息
  2. 作者简介
  3. 内容简介
  4. 推荐序一
  5. 推荐序二
  6. 推荐序三
  7. 推荐语
  8. 致谢
  9. 说明
  10. 第1章 高可用概述
  11. 1.1 什么是高可用
  12. 1.2 高可用设计概述
  13. 第2章 代理和连接池
  14. 2.1 代理和连接池架构
  15. 2.2 通过HAProxy实现代理
  16. 2.3 PgBouncer
  17. 2.4 Odyssey
  18. 2.5 虚拟IP地址高可用
  19. 第3章 PostgreSQL流复制
  20. 3.1 流复制概念
  21. 3.2 PostgreSQL流复制历程
  22. 3.3 流复制基础 ——WAL
  23. 3.4 物理流复制
  24. 3.5 逻辑复制
  25. 第4章 备份恢复管理
  26. 4.1 备份恢复管理概述
  27. 4.2 原生备份恢复工具
  28. 4.3 第三方备份恢复工具之pg_probackup
  29. 4.4 第三方备份恢复工具之pgBackRest
  30. 4.5 第三方备份恢复工具之pg_rman
  31. 第5章 使用repmgr实现高可用性
  32. 5.1 repmgr介绍
  33. 5.2 安装和部署
  34. 5.3 集群配置
  35. 5.4 服务管理
  36. 5.5 在线维护和升级
  37. 第6章 使用Patroni实现高可用性
  38. 6.1 Patroni概述
  39. 6.2 相关组件介绍
  40. 6.3 安装和配置
  41. 6.4 在线维护和升级
  42. 6.5 日常操作
  43. 6.6 多主机URL客户端访问配置
  44. 第7章 多主复制高可用
  45. 7.1 多主节点介绍
  46. 7.2 确定多主节点是否适合当前需求
  47. 7.3 安装BDR
  48. 7.4 安全使用序列
  49. 7.5 为多主节点方法配置HAProxy
  50. 7.6 执行托管节点切换
  51. 7.7 提高故障切换速度
  52. 7.8 在线执行重大版本升级

FAQ

Can I read this book without any PostgreSQL basics?
Not really recommended. The book is centered on cluster setup, failover, and tool usage, and assumes familiarity with basic PostgreSQL installation, configuration, and SQL operations. Without any background, it is better to first learn single-instance installation, parameter configuration, and backup and restore basics; the book will then go much more smoothly, otherwise you may get stuck on command and configuration details.
What kind of lab environment do the high-availability solutions in the book require?
The book involves multi-node clusters, replication, and failover, which are hard to reproduce fully on a single machine. It is advisable to prepare several Linux hosts or virtual machines that can form a small cluster, with enough disk space for backup experiments. For specific configuration requirements, refer to the explanations in each experiment chapter and adjust resources as needed.
Which should I learn first: repmgr, Patroni, or BDR?
Follow the book's order: start with repmgr to understand the basics of streaming replication and primary-standby failover; then Patroni to see the differences in automatic failover and configuration management; finally BDR multi-master replication to compare multi-master and single-master trade-offs in conflict handling and operational complexity. This simple-to-complex path sharpens your judgment when selecting solutions.
Is this book suitable as a day-to-day operations manual?
It can partly serve as a manual, especially the configuration examples for backup tools and connection pooling and the cluster setup steps, which are suitable for reference during experiments and troubleshooting. But it is more a hands-on tutorial than a complete command dictionary; for specific parameter details, cross-check with the official documentation.

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

About the author

胡辉 Author

Hu Hui, about whom limited public information is available, works across both technical practice and popular history. In technical publishing, he focuses on databases and business data analysis; he is the author of PostgreSQL High Availability in Practice and has contributed to Excel Business Data Analysis and Application (MOOC Edition, 2nd Edition) and Business Data Visualization (Full-Color Micro-Lecture Edition), which are oriented toward practical use and teaching. In popular history, he has written biographies of historical figures such as Shi Kefa, Huo Qubing, Zu Ti, Wen Tianxiang, and Huang Zongxi for the Chinese Sages Story Series, several of which were selected as key publications for the Publicity Department of the CPC Central Committee's themed publishing program, presenting these figures' lives and spirit to general readers through narrative. His works span a broad range of subjects, balancing knowledge transmission with accessible reading, and twelve of his titles are held in the collection.

崔鹏 Author

Cui Peng is an author about whom limited public information is available. His writing and editorial work span programming and design, inspirational personal growth, and social psychology. Three of his works are included in the collection: the technical title PostgreSQL High Availability in Practice and two inspirational classics, How to Win Friends and Influence People and How to Stop Worrying and Start Living (the complete Carnegie classic motivational series). Judging from this range of subjects, he attends both to practical technical questions such as high-availability database architecture and to the presentation of Carnegie's motivational works, moving between technical practice and personal development. The technical work leans toward engineering practice and implementable solutions, while the inspirational titles center on interpersonal communication, mindset adjustment, and self-improvement. This cross-disciplinary selection allows his works to serve professional readers studying technology as well as general readers interested in psychology and personal growth, balancing practicality with readability.

邓琼 Author

Deng Qiong is an author whose works span the fields of programming and parenting. Public information about her is limited, and her dates of birth and death, nationality, and educational background are not clearly recorded. Judging from the two works held in the collection, her writing covers a considerable range: PostgreSQL High Availability in Practice addresses the practical application of database technology, focusing on stable operation and maintenance solutions under high-load conditions, and belongs to the category of hands-on technical writing. The Wind Steals My Red Wool Hat, by contrast, is classified as parenting and is closer to family life and children's reading. The contrast between these two works suggests that the author can handle rigorous technical subjects as well as write in a relaxed manner for parents and children. Because biographical information is lacking, it is difficult at present to trace her full creative development; readers may nonetheless use these two works to understand her different approaches to technical and parenting writing.

More by the same author

Top rated in the same category