PostgreSQL Replication

Replication is an advanced subject but this tutorial makes it so simple to assimilate thanks to a carefully structured approach based on examples and screenshots. As a PostrgreSQL administrator it will expand your horizons.

PostgreSQL Replication

Progressing
Zoltan Böszörmenyi, Hans-Jürgen Schönig

Replication is an advanced subject but this tutorial makes it so simple to assimilate thanks to a carefully structured approach based on examples and screenshots. As a PostrgreSQL administrator it will expand your horizons.
$10.00
$49.99
RRP $29.99
RRP $49.99
eBook
Print + eBook
$12.99 p/month

Get Access

Get Unlimited Access to every Packt eBook and Video course

Enjoy full and instant access to over 3000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Code Files
+ Collection
Free Sample

Book Details

ISBN 139781849516723
Paperback250 pages

About This Book

  • Explains the new replication features introduced in PostgreSQL 9
  • Contains easy to understand explanations and lots of screenshots that simplify an advanced topic like replication
  • Teaches PostgreSQL administrators how to maintain consistency between redundant resources and to improve reliability, fault-tolerance, and accessibility

Who This Book Is For

"PostgreSQL Replication" is ideal for PostgreSQL administrators who want to set up and understand replication. If you want to make your databases more robust, more secure, faster, and more scalable, you will find all the information you need in this single book focusing exclusively on PostgreSQL replication. It is assumed that you already have some basic experience with PostgreSQL.

Table of Contents

Chapter 1: Understanding Replication Concepts
The CAP theory and physical limitations
Different types of replication
Using sharding and data distribution
Summary
Chapter 2: Understanding the PostgreSQL Transaction Log
How PostgreSQL writes data
The XLOG and replication
Understanding consistency and data loss
Tuning checkpoints and the XLOG
The internal structure of the XLOG
Summary
Chapter 3: Understanding Point-In-Time-Recovery
Understanding the purpose of PITR
Archiving the transaction log
Taking base backups
Making use of traditional methods to create base backups
Tablespace issues
Keeping an eye on network bandwidth
Replaying the transaction log
Summary
Chapter 4: Setting up Asynchronous Replication
Setting up streaming replication
Configuring a cascaded replication
Turning slaves to masters
Mixing streaming and file-based recovery
Making the streaming-only replication more robust
Efficient cleanup and the end of recovery
Conflict management
Dealing with the timelines
Summary
Chapter 5: Setting up Synchronous Replication
Setting up synchronous replication
Understanding practical implications and performance
Redundancy and stopping replication
Summary
Chapter 6: Monitoring Your Setup
Checking your archive
Checking pg_stat_replication
Checking for operating system processes
Dealing with monitoring tools
Summary
Chapter 7: Understanding Linux High Availability
Understanding the purpose of high availability
Measuring availability
History of high-availability software
Terminology and concepts
High availability is all about redundancy
PostgreSQL and high availability
Summary
Chapter 8: Working with pgbouncer
Understanding fundamental pgbouncer concepts
Installing pgbouncer
Configuring your first pgbouncer setup
Improving performance
Maintaining pgbouncer
Summary
Chapter 9: Working with pgpool
Installing pgpool
Understanding pgpool features
Understanding the pgpool architecture
Setting up replication and load balancing
Checking replication
Running pgpool with streaming replication
Dealing with failovers and high availability
Summary
Chapter 10: Configuring Slony
Installing Slony
Understanding how Slony works
Replicating your first database
Deploying DDLs
Adding tables to replication and managing problems
Performing failovers
Summary
Chapter 11: Using Skytools
Installing skytools
Dissecting skytools
Managing pgq-queues
Using londiste to replicate data
One word about walmgr
Summary
Chapter 12: Working with Postgres-XC
Understanding the Postgres-XC architecture
Installing Postgres-XC
Configuring a simple cluster
Optimizing for performance
Creating the tables and issuing the queries
Adding nodes
Handling failovers and dropping nodes
Summary
Chapter 13: Scaling with PL/Proxy
Understanding the basic concepts
Setting up PL/Proxy
Extending and handling clusters in a clever way
Summary

What You Will Learn

  • Recover a PostgreSQL database to a certain point in time
  • Set up asynchronous and synchronous streaming replication
  • Handle transaction log files efficiently
  • Learn about Linux High Availability
  • Get to grips with Slony replication
  • Get PL/Proxy to scale infinitely
  • Understand pgpool and pgbouncer to improve speed and reliability
  • Perform fast on-the-fly backups
  • Increase reliability and throughput
  • Improve data security and geographically distribute data

In Detail

PostgreSQL offers a comprehensive set of replication related features, which can be used to make your database servers more robust and way more scalable. Unleashing the power of PostgreSQL provides the user with countless opportunities and a competitive advantage over other database systems. To make things more powerful, PostgreSQL can be used in conjunction with a handful of sophisticated tools serving various different needs such as queuing, logical replication, or simplified transaction log handling.

"PostgreSQL Replication" is a practical, hands-on guide to PostgreSQL replication. It will provide you with the theoretical background as well as simple examples showing you how to make replication work on your system. A broad toolchain will be presented along with mature PostgreSQL-core technology.

"PostgreSQL Replication" starts with an introduction to replication concepts as well as the physical limitations of different replication solutions. You will be guided through various techniques such as Point-In-Time-Recovery, transaction-log-based replication and you will be introduced to a set of replication-related tools. In the final chapter you will learn to scale PostgreSQL to many different servers using PL/Proxy.

You will learn how to reset PostgreSQL to a certain point in time and figure out how to replicate data in many ways. You will deal with both synchronous as well as asynchronous replication. In addition to that, the book covers important topics, such as Slony, and upgrades with virtually no downtime. We will also cover important performance-related topics to make sure your database setups will provide you with high speed AND high availability.

"PostgreSQL Replication" contains all the information you need to design and operate replicated setups. You will learn everything you need to know for your daily work and a lot more.

Authors

Table of Contents

Chapter 1: Understanding Replication Concepts
The CAP theory and physical limitations
Different types of replication
Using sharding and data distribution
Summary
Chapter 2: Understanding the PostgreSQL Transaction Log
How PostgreSQL writes data
The XLOG and replication
Understanding consistency and data loss
Tuning checkpoints and the XLOG
The internal structure of the XLOG
Summary
Chapter 3: Understanding Point-In-Time-Recovery
Understanding the purpose of PITR
Archiving the transaction log
Taking base backups
Making use of traditional methods to create base backups
Tablespace issues
Keeping an eye on network bandwidth
Replaying the transaction log
Summary
Chapter 4: Setting up Asynchronous Replication
Setting up streaming replication
Configuring a cascaded replication
Turning slaves to masters
Mixing streaming and file-based recovery
Making the streaming-only replication more robust
Efficient cleanup and the end of recovery
Conflict management
Dealing with the timelines
Summary
Chapter 5: Setting up Synchronous Replication
Setting up synchronous replication
Understanding practical implications and performance
Redundancy and stopping replication
Summary
Chapter 6: Monitoring Your Setup
Checking your archive
Checking pg_stat_replication
Checking for operating system processes
Dealing with monitoring tools
Summary
Chapter 7: Understanding Linux High Availability
Understanding the purpose of high availability
Measuring availability
History of high-availability software
Terminology and concepts
High availability is all about redundancy
PostgreSQL and high availability
Summary
Chapter 8: Working with pgbouncer
Understanding fundamental pgbouncer concepts
Installing pgbouncer
Configuring your first pgbouncer setup
Improving performance
Maintaining pgbouncer
Summary
Chapter 9: Working with pgpool
Installing pgpool
Understanding pgpool features
Understanding the pgpool architecture
Setting up replication and load balancing
Checking replication
Running pgpool with streaming replication
Dealing with failovers and high availability
Summary
Chapter 10: Configuring Slony
Installing Slony
Understanding how Slony works
Replicating your first database
Deploying DDLs
Adding tables to replication and managing problems
Performing failovers
Summary
Chapter 11: Using Skytools
Installing skytools
Dissecting skytools
Managing pgq-queues
Using londiste to replicate data
One word about walmgr
Summary
Chapter 12: Working with Postgres-XC
Understanding the Postgres-XC architecture
Installing Postgres-XC
Configuring a simple cluster
Optimizing for performance
Creating the tables and issuing the queries
Adding nodes
Handling failovers and dropping nodes
Summary
Chapter 13: Scaling with PL/Proxy
Understanding the basic concepts
Setting up PL/Proxy
Extending and handling clusters in a clever way
Summary

Book Details

ISBN 139781849516723
Paperback250 pages
Read More