~/talk

Using Multiple Databases with Active Record

Talkat Rails World 2023 · 2023-10-05..10-06· [ruby-on-rails, databases]
links:none on file
slides:none on file

Rails 6’s native multiple-database support replaces an old gem and is used at Harvest after a June 2020 upgrade; production runs one primary and six replicas (four serving production), with Percona MySQL, ProxySQL for replica load balancing and Orchestrator for failover. Code uses a database.yml with primary/replica roles, middleware resolver for automatic connection switching, session- or header-based context and an around_action concern for API routing; also uses prevent_writes checks. A deploy bug (reordered includes) briefly broke routing to replicas.

AI-written summary · about

  1. 0:00Introduction to rails
  2. 3:07Overview of multiple databases
  3. 4:29Database concepts and types
  4. 6:49High availability strategies
  5. 8:46Sharding and security
  6. 11:22Implementing in rails
  7. 13:03Rails 6 native support
  8. 15:27Code configuration
  9. 17:28Connection switching
  10. 18:55Automatic swapping
  11. 20:47Read/Write separation
  12. 22:28Middleware implementation
  13. 24:50Context and API usage
  14. 27:26Controller concerns
  15. 29:08Results and conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.