Posted by Craig Kerstiens
Today we’re releasing the ability to follow your Heroku Postgres Database into General Availability: this lets you easily create multiple read-only asynchronous replicas of your database, known as followers.
After an extended beta period during which over 3,000 followers were created, many of which help power core Heroku systems, we’re excited to make the ability to safely and easily scale out access to your data available to all Heroku Postgres users.
Followers enable some great use cases:
One use case that has historically been challenging in database management is setting up a read replica, often referred to as a read slave. Traditionally this would require significant effort to provision, setup and configure machines and databases. Due to the time involved in this, most application developers opt for scaling up their database, rather than horizontally scaling out, an approach that can sustain significantly larger growth. During times of intense load, this leaves developers with no option to quickly reduce the load on their database without incurring significant downtime, resulting in databases becoming a liability, as opposed to adding value to a developer’s toolbox.
When you follow a database you are given an entirely new follower which maintains a relationship to its leader. Your follower receives asynchronous updates from its leader and is often just seconds behind. Followers can be created with any of our production-tier plans. And with the recent release of our $50/mo Crane and $100/mo Kappa plans, these features are now available to an even wider audience than ever before. Creating a follower from an existing production database is as simple as:
$ heroku addons:add heroku-postgresql:crane --follow HEROKU_POSTGRESQL_LAVENDER Adding heroku-postgresql:crane on craig... done, v114 ($50/mo) Attached as HEROKU_POSTGRESQL_PINK_URL Follower will become available for read-only queries when up-to-date Use `heroku pg:wait` to track status Use `heroku addons:docs heroku-postgresql:crane` to view documentation.
This command creates a new Heroku Postgres follower of a crane plan which is following a Heroku Postgres Database named Lavender. Followers can also easily be created by selecting from within the Followers area of the Heroku Postgres management dashboard:
Heroku strives to provide tooling that empowers our customers to build and scale applications more easily; the ability to follow your database is a clear step in that direction. We’ve already seen 3 great use cases as outlined above, and we’re excited to see how the community takes this to the next level. If you're using a Production Heroku Database use follow to scale your database without fear! Visit Heroku Postgres to learn more about Heroku Postgres and to start creating followers today.