Multiple Backend DBs In A Rails Application
summary
Rails handles four separate source databases of front-end web events by loading per-database config files at init and picking one default DB for Rails metadata. Each DB gets its own folders (migrations, seeds, structure) and models inherit from a base ActiveRecord class that establishes that DB connection. Team adds rake tasks per DB and custom migration generators, uses PostgreSQL partitioning and a pg_copy wrapper for fast bulk loads, and versions stored-procedure and view code; the setup works in production.
AI-written summary · about
chapters (14)
- 0:00Start
- 1:44The challenge
- 2:34Hard decisions
- 2:44Let's try rails!
- 3:07Let's try rails in Malaysia!
- 3:17Rails app with a single DB
- 3:43Rails app with multiple DBS
- 4:02Hey, Mr. Meeseks!
- 4:46Initialize DB configs
- 5:15Default rails app DB
- 5:39What does it do?
- 6:37Create base models
- 7:17Create a set of rake tasks...
- 10:07Where to find me
related talks
30mUsing Multiple Databases with Active Record
39mPostgres & Rails 6 Multi-DB: Pitfalls, Patterns, Performance
56mScaling Rails API to Write-Heavy Traffic
30m"Using Multiple Databases in Django Applications"
43mThe Magic of Rails
45mSQLite on Rails: Everything you need to know
20mSafely Decomposing a Highly Available Rails App
32mHow I architected my big Rails app for success!
