Database Replica

Episode #516 by Teacher's Avatar David Kimura

Summary

In this episode, we'll look at database connection switching within a Rails application to switch between a primary and replica database. This has many benefits on applications which many many read and write transactions.
rails database docker 17:58

Chapters

  • Introduction (0:00)
  • Creating the Replica (3:16)
  • Testing the Replica (8:38)
  • Setting up the database.yml (9:34)
  • Testing the primary database (9:59)
  • Manual connection to the replica (11:13)
  • Setting up the reading role (11:49)
  • Fixing the database.yml (12:29)
  • Testing the replica (13:01)
  • Automatic switching (13:58)
  • Final Thoughts (16:13)
Student & Teacher
$ 9 /mo

Valid School Email Required

Same Access as Pro

Subscribe Now
Pro Monthly
$ 19 /mo

Access to Pro Episodes

Invite to Slack Channel

Priority Suggestions

Ad Free

Subscribe Now
Pro Annual
$ 190 /yr

Access to Pro Episodes

Invite to Slack Channel

Priority Suggestions

Ad Free

Subscribe Now
Teams
$ 57 /mo

3 Users Minimum

$19.00 / user / month

Same Access as Pro

Subscribe to Teams