Book Image

Heroku Cookbook

By : Mike Coutermarsh
Book Image

Heroku Cookbook

By: Mike Coutermarsh

Overview of this book

Heroku is a Platform as a Service that enables developers to rapidly deploy and scale their web applications. Heroku is designed for developer happiness, freeing developers from doing system administrative tasks such as configuring servers and setting up load balancers. Developers are able to focus on what they do best, building web applications, while leaving the details of deployment and scaling to the experts at Heroku. This practical guide is packed with step-by-step solutions to problems faced by every production-level web application hosted on Heroku. You'll quickly get comfortable with managing your Heroku applications from the command line and then learn everything you need to know to deploy and administer production-level web applications.
Table of Contents (17 chapters)
Heroku Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a read-only follower


Follower databases can be used to create redundancy, scaling, or upgrading your existing database. Once a follower is set up, all data written to the primary database will be synced over to the follower. In this recipe, you will learn how to quickly get a follower set up and synced with your primary database.

Note

Primary/follower databases are also commonly referred to as master/slave. On Heroku and in this book, we'll be using the terms primary and follower.

How to do it…

We'll be setting up our follower database using the Heroku dashboard.

Note

Followers can only be created for Standard or Premium databases. We'll need to upgrade if we are using a development or hobby-level database. To see if followers are available on our database, we can run $ heroku pg.

We will perform the following steps:

  1. Let's open a browser and go to https://postgres.heroku.com/databases and click on our application's primary database.

  2. Next, we'll click on the gear icon in the top-right corner...