Turns out, being a follower instead of a leader can be a good thing, at least when it comes to Postgres. Heroku announced last week that its in-PaaS database support for Postgres now includes the ability to create “Followers.” Followers are asynchronous, read-only copies of the databases developers rely on for their applications.
For developers, this means a direct copy of a running database can be spun up and used to replace the active one for upgrades, or when there is need for expanded capacity on the database tier.
Heroku is offering Followers as a solution to the problems associated with keeping a single database of information spread out across slaves in a cluster fashion. The service is available to all languages used on Heroku, and is also available in its standalone database services.
Craig Kerstiens is product manager of Heroku Postgres, and he said there are a number of use cases he’s seen from developers who participated in the earlier versions of this service, before it was formally announced.
“We have a lot of users that will maintain [a Follower] and keep it around for failover, so if something happens to the leader database, you can failover to [the Follower],” he said. “Then there are other users who bring them online for an hour or two to help with a burst of traffic. You can bring one online and split read traffic to it, and have write traffic go to your leader, and then get rid of [the Follower] later.”
Key to this capability is the fact that creating a Follower doesn’t slow down the primary database, said Kerstiens. “It does not interrupt the primary database. Under the covers, we capture a database backup, so we stream the write-ahead log and it’s archived elsewhere, so we can bring it online with no real impact on what you’re seeing on performance.”
Today, Kerstiens said he’s seen users with as many as four or five Followers up and running, and he said there’s no hard limit to how many can be used at once. Though he expects there will be some ceiling associated with capacity, he said users have not yet hit that limit.