Retail · Distributed ERP
Every checkout sends head office a tiny daily summary — not a firehose of every sale. From those summaries the central books rebuild exactly, and the whole thing keeps working when the network is bad, a server crashes, or a store burns down.
One small message listing the morning replenishment received into the store.
One small message: the day’s takings (to the cent) and the stock consumed. The full sale-by-sale detail stays at the store — only the summary travels.
Legacy: tendered through the central server / broker — another hop that can stall the sale.
Legacy: a central member lookup on every sale — slow when the line is down.
Legacy: you custody all their data — a breach liability and a compliance burden.
Legacy: sales stall, queue, or fail when the link to the server is down.
Legacy: restore from last backup; anything since the backup can be lost.
Legacy: whatever never reached the server is gone for good.
Big ERP systems share one central “next document number” counter. Every till has to queue for it — that’s what chokes them at thousands of tills. We let each till number its own.
Every till waits its turn
At 10,000 tills that’s 90,000 locked hand-offs a day — the queue is the wall.
No queue, no clashes
Same 90,000 documents, 0 clashes, no central lock. The wall is gone.
| What matters to you | Legacy centralized ERP / POS | This approach (measured) |
|---|---|---|
| What each till sends | Every sale, in real time, to the central server | 2 small messages a day per till |
| Bad / dropped network | Sale stalls or queues; leans on the server being up | Till runs on its own; sends its summary when it can |
| The “next document number” | One shared counter — every till queues (the choke point) | Removed — each till numbers its own |
| A message gets re-sent | Risk of double-counting; needs careful handling | Duplicate ignored — safe to retry |
| Head-office server crashes | Restore from last backup; gap can be lost | Rebuilds from its log — nothing lost |
| A store burns down | Whatever didn’t reach the server is gone | Recovered from a signed, tamper-proof backup |
| Rebuild books from the summaries | N/A — server already holds it all | Proven exact to the penny |
| Scale we tested | Needs a server farm + tuning to push high till counts | 10,000 tills on one laptop, straight-line scaling |
| Infrastructure | Central servers, DB licences, ops team | No server farm; runs lean |
| Card payments | Routed via the central server / broker | Till ↔ processor direct; result is a signed receipt line, auto-reconciled to the cent |
| Members & points | Central member-DB lookup per sale | Phone-identified; earn adds up offline, redeem checked against one shared balance |
| Customer data | You custody all of it (breach risk) | Customer’s phone owns its receipts; you hold only what the books need |
| Honest caveat | Decades of features (finance, HR, manufacturing…) | This proves the reporting + recovery backbone at scale, not the full feature catalogue. One known gap: two stores inventing the same brand-new product at once needs more work. |
Same books, to the penny — but it survives bad networks, crashes and fires, and it doesn’t hit the wall that bogs legacy systems down at thousands of tills.
ad_seed_fullwidth.db): a real product, its real price, its real bill-of-materials recipe.
The fleet size N (200 → 10,000) is the only made-up number — each till replays that one real unit.
Nothing is invented; the per-store totals trace to actual rows.2N-ops column. The relay just orders and de-duplicates them; it computes nothing.reports/sec
= messages ÷ seconds. It stays high as N grows because the work per message is fixed — that’s the
“straight line”, and why the bars rise rather than collapse.Run it yourself — Node.js, no server, ~10 seconds
# full sweep 200 → 10,000 tills (writes build/erp/poc_pos_wan_scale.log) node scripts/poc_pos_wan_scale.js # quick check at two sizes node scripts/poc_pos_wan_scale.js 200,1000