Chapter 13Scaling with Replication and Sharding

In earlier chapters, you ran PostgreSQL on your local server running the Rideshare databases.

PostgreSQL is a single primary database, meaning just one server receives writes. What happens when your needs expand beyond the capabilities of a single server? What if your primary database fails and you need to bring a new server in quickly? What if you’d like to run multiple copies of your database structure that different customers use on different servers so that their server resources and storage are isolated? How can that be achieved?

In this chapter, you’ll tackle the underpinnings needed to unlock these use cases and more. To get there, you’ll move beyond a single PostgreSQL instance and set ...

Get High Performance PostgreSQL for Rails now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.