External Publication
Visit Post

44/60 Days System Design Questions

DEV Community [Unofficial] June 19, 2026
Source

Your team just shipped "offline mode" for your field-service app. Technicians work in basements, tunnels, plant floors — connectivity is unreliable.

The demo looked great. Navigator.onLine said false, the app kept working, the sync button pulsed green. You shipped to 400 users.

Then the incident reports started.

Technician in Munich finishes a repair job offline, syncs when she gets signal. Her updates are gone — overwritten by a colleague who edited the same record online 12 minutes earlier. Last-write-wins. Her write lost.

Technician in São Paulo opens the app, goes offline, edits three assets. Comes back online. App throws an unhandled promise rejection and crashes. IndexedDB schema was on version 2. The update shipped version 3. The migration never ran because he'd never opened the app while online.

You're now asked to actually fix offline-first — not demo it.

Here's the setup:

• 400 field technicians, avg offline window of 40 minutes • Write conflicts happen ~3x per day, always on the same 8 "hot" assets • Sync currently runs on reconnect via a single bulk POST • IndexedDB is being used but schema migrations are undocumented • You need conflict resolution, migration safety, and sync reliability

What's your architecture?

A) Move everything to localStorage + a manual JSON diff on sync. Simpler API, deterministic schema versioning — no IndexedDB migration headaches.

B) Keep IndexedDB, add a vector-clock field to every record. On sync, compare clocks — if diverged, surface a merge UI. Let the technician decide. Never throw away a write.

C) Wrap IndexedDB in a versioned schema migration layer (like Dexie.js). Add a per-record updated_at + device_id composite key. Last-write-wins, but last-write is now deterministic and auditable.

D) Replace client-side storage with a CRDT-based sync engine (Automerge or Yjs). Operations are commutative and associative — merge is always valid, conflicts are structurally impossible.

Pick one — A, B, C, or D — and tell me why. Full breakdown in the comments (including the one that sounds like overengineering but is what Linear, Figma, and Notion actually run).

Drop your answer

Discussion in the ATmosphere

Loading comments...