Case study · Built at Edition
Expansion Store Sync
A multi-store synchronisation system, shipped as a Shopify app. One master store keeps any number of market stores in sync: products, inventory, collections, metaobjects, pages, blogs and metafields, with rules, prices and translations per store.
1.5M
product updates in < 24 h
Expansion Store Sync
2025–26 · Built at Edition
- Year
- 2025–26
- Role
- Solo developer
- Built at
- Edition
- Type
- Sync system · Shopify app
- Status
- Live
- Next.js
- TypeScript
- Polaris
- PostgreSQL
- Prisma
- Redis
- BullMQ
- Shopify GraphQL
- Docker
The challenge
A merchant expanding into new markets runs one Shopify store per market. Keeping products, stock and content identical by hand across every store doesn't scale, and each market still needs its own prices, exclusions and language. On top of that, Shopify limits how fast any app may call each store, so a naive sync either crawls or gets throttled.
The approach
- 01
Webhook-driven
A change in the master store becomes a background job that syncs only that change to every child store. Composite hashes of each product detect what actually changed, so duplicate and no-op webhooks exit early and unchanged text is never translated twice.
- 02
Rate limits handled at the source
A token bucket in Redis, updated atomically in Lua, mirrors Shopify's own model per store. Every process and worker draws from the same balance, and each store's pace is tuned to the real cost of its queries.
- 03
Fair under load
A per-store concurrency gate reschedules jobs instead of blocking workers, so one store flooding the queue with edits never starves the others.
- 04
Two-way inventory without loops
When the app writes stock to a store, Shopify echoes it back as a new change. An echo blocker recognises its own writes and ignores them, while real sales seconds later still sync.
- 05
Full-catalogue syncs in bulk
Products are written in chunks with Shopify's bulk mutations, compared again in a second round, and anything still failing falls back to a single-product sync. These run at lower priority than live edits, so merchants' changes stay fast.
- 06
Variants matched, never guessed
A child's variants are matched to the master's in four passes: SKU or barcode, the identifier from the last sync (which catches a renamed SKU), option values, then elimination. Anything still ambiguous is left unmatched rather than overwritten.
- 07
Per-store control
Per-store rules for every field (sync on creation, on every update, or never), pricing formulas for local markets, exclusions, location mapping, machine translation with usage-based credits, and a sync history that logs every change on every store.
The outcome
Live on the Shopify App Store since January 2026 under Edition, with paid plans from $25 a month and a 5.0 rating from merchants. In one store network it synced over 1.5 million product updates in under 24 hours.
Every Admin API call is paced by a shared token bucket in Redis, so the system runs at each store's real Shopify rate limit without getting throttled. It has synced over 1.5 million product updates from a single store network in under 24 hours.
How it works
Life of a change
What happens between a merchant saving a product in the master store and the same change landing in every market store.
- 01
Only real changes move on
The product is fetched fresh from the master and hashed per field and per variant. If nothing actually changed the sync ends here; otherwise only the changed fields, variants and metafields go on.
- 02
Each store gets its own version
Paused stores and stores whose exclusion rules match are skipped. For the rest, each store's field rules decide what moves: sync on creation, on every update, or never.
- 03
Paced to each store's limit
Up to five stores are written in parallel. A per-store gate, tuned from Shopify's own throttle status, decides when each may run, and every API call draws from that store's shared token bucket.
- 04
Written in the store's own terms
One full product write per store, with its pricing rules applied, references remapped to its own IDs and files resolved to its own copies. Values a store's setup doesn't accept are dropped, not forced.
- 05
Translated, then logged
Translated fields keep their current text while a translation job is queued, under a lock so the two never cross. Every store gets a sync history entry with before and after values.
Key decisions
Why it's built this way
01
A shared token bucket in Redis
over retrying when throttled
Every process and worker draws from one balance per store, so the sync runs at Shopify's real limit instead of hitting it and backing off.
02
Syncing only what changed
over re-syncing whole products
Composite hashes let duplicate and no-op webhooks exit early, and unchanged text is never translated, or paid for, twice.
03
Webhooks subscribed per store
over a fixed list for every install
Only the master store gets product webhooks. With a fixed list, a 41-store network received over 160 deliveries per change that the market stores could only drop.
04
Leaving a variant unmatched
over a best guess
A wrong match overwrites the wrong variant in a live store. Leaving it unmatched does no damage.
05
Renaming options in place
over letting Shopify rebuild variants
When an option is renamed on the master, a rebuilt variant in a market store would lose its price, SKU and barcode. Renaming it in place keeps them.
06
Reserving a time slot
over retrying when a store is busy
A job over a store's limit is booked for the next free slot instead of holding a worker. A bulk edit of 1,800 products showed why: retrying jobs bounced off the limit dozens of times each.
07
A preview before every full sync
over writing straight away
A full-catalogue sync reads and compares every store first, then waits for the merchant to confirm. If translation runs long, the stores are read again so manual edits aren't overwritten.
08
Refreshing tokens early, once
over refreshing when a call fails
When a token expired mid-sync, every call failed and the retries ran out within seconds. Now one process refreshes it five minutes early, under a lock.
09
Claiming every upload
over trusting retries
Two updates close together could upload the same image twice. An upload is claimed by the job doing it and sealed once done, so a retry neither skips nor duplicates.
Next case study
Edition – DataLayer & Tracking