Book Image

PostgreSQL Replication, Second Edition

Book Image

PostgreSQL Replication, Second Edition

Overview of this book

Table of Contents (22 chapters)
PostgreSQL Replication Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 13. Scaling with PL/Proxy

Adding a slave here and there is really a nice scalability strategy, which is basically enough for most modern applications. Many applications will run perfectly well with just one server; you might want to add a replica to add some security to the setup, but in many cases, this is pretty much what people need.

If your application grows larger, you can, in many cases, just add slaves and scale out reading. This too is not a big deal and can be done quite easily. If you want to add even more slaves, you might have to cascade your replication infrastructure, but for 98 percent of all applications, this is going to be enough.

In those rare, leftover 2 percent of cases, PL/Proxy can come to the rescue. The idea of PL/Proxy is to be able to scale out writes. Remember that transaction-log-based replication can scale out only reads; there is no way to scale out writes.

Tip

If you want to scale out writes, turn to PL/Proxy. However, before this is done, consider fixing...