Menu

Building an Offline-First POS That Stays Consistent With an Online Store
πŸ“°

Building an Offline-First POS That Stays Consistent With an Online Store

DEV Community: dotnetΒ·StoreFluxΒ·15 days ago
#Jd6chSCX
#devtodotnet#devto#dev#pos#server
Reading 0:00
15s threshold

We just shipped a Windows point of sale for StoreFlux (a headless commerce backend) that keeps working with no internet connection and never drifts out of sync with the online store it's attached to. Wanted to write up the actual mechanics, since "offline-first" gets used a lot as a buzzword without the plumbing behind it.

An outbox of idempotent events, not a sync API

Every action at the till β€” a sale, a refund, a shift open/close, a stock adjustment, a product edit β€” gets written to a local SQLCipher database in the same transaction as the receipt and the stock change, plus one row in an outbox table. A background loop drains that outbox to the server in order. Each event carries a client-generated id, and the server only ever applies a given id once.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.