~/talk

Migrating Shopify’s Core Rails Monolith to Trilogy

Talkat RailsConf 2023 · 2023-04-24..04-26· [databases]
slides:none on file

Shopify migrates its Rails monolith from mysql2 to Trilogy, implements multi-statement support and a com_set_option path in the C API, and updates the ActiveRecord adapter to iterate results (abandoned results not available). Rollout uses a 1% rollout then a 50% ramp that triggers proxySQL churn until adding the missing CLIENT_MULTI_RESULTS flag fixes it. Production shows ~22% faster request latency and ~17% faster query time, and the adapter is upstreamed into Rails 7.1.

AI-written summary · about

  1. 0:00Trilogy migration at Shopify
  2. 2:25Trilogy database client overview
  3. 7:29Why switch to Trilogy
  4. 9:14MySQL protocol explained
  5. 13:07Multi-statement support in Rails
  6. 15:53Implementing multi-statement
  7. 21:50ActiveRecord adapter changes
  8. 23:15Code migration MySQL 2 to Trilogy
  9. 28:17Safe production deployment
  10. 31:47Debugging rollout failure
  11. 34:15100% production rollout
  12. 36:20Trilogy results and future
~/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.