~/talk

Scaling Rails API to Write-Heavy Traffic

Talkat RailsConf 2021 · 2021-04-12..04-15· [ruby-on-rails, databases]
slides:none on file

Mobile-game backends serve tens of millions of users and millions of DB transactions per minute by using multiple databases with sharding, manual read/write switching, DNS-based service discovery and weighted sampling for dynamic shard allocation. Rails apps run on MySQL with replication (Rails 6 read‑your‑write 2s default), resource-focused API responses include affected resources to avoid reads, and partial resharding or pool/push/double-write patterns keep locality. Practical additions: connection pooling fixes, at‑least‑once message queues, real multi‑DB load tests; result is high write scalability with tolerable eventual consistency.

AI-written summary · about

  1. 0:00Start
  2. 3:17Mobile Game API Backends: System Overview
  3. 25:47Scenario: Join a Guild and Defeat a Raid Boss
  4. 26:25Solution: Partial Resharding
  5. 29:08Overview of 2 Phase Commit for Comparative Study
  6. 32:02Reduce Risk of Cross-Shard Transaction Anomalies
  7. 35:36Keep Inconsistency Observable and Acceptable
  8. 38:12Keep Idempotency and Reach Eventual Consistency
  9. 40:18Utilize At Least Once Message Queue for Strict Completion
  10. 50:34Conduct Load Test before Service Launch
  11. 53:53Summary: Scaling Rails API to Write Heavy Traffic
~/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.