Read Consistency with Database Replicas - Shopify
Feb 22, 2021

Summary
Introduces a solution for monotonic read consistency in database replicas by modifying ProxySQL. This involves using a `consistent_read_id` in query comments to hash and deterministically select a replica for a series of related reads, ensuring a coherent data timeline. Addresses two key issues: handling server unavailability by indexing into the full list of configured servers and then disqualifying unavailable ones, and disabling ProxySQL's secondary load balancing for consistent read requests to prevent overriding the hash-based selection.
More from the Data Store Selection and Usage trail
- We replaced Redis with MySQL for inventory reservations—and it scaled (2026) - Shopify
- Mitigating Deadlocks in high concurrency environments - Shopify
- Safely Adding NOT NULL Columns to Your Database Tables - Shopify
- Double Entry Transition Tables: How We Track State Changes At Shopify - Shopify
- Shopify’s Unique Data Science Hierarchy Of Needs - Shopify