All posts
Mobile Apps
3 min read• 12/2/2026

Local-First SQLite Sync: You Probably Don't Need CRDTs

CRDTs introduce massive overhead on mobile. Learn why deterministic Last-Write-Wins with SQLite change triggers is faster, cleaner, and simpler.

Share X LinkedIn

Tip: use ← / → to browse posts.

Local-First SQLite Sync: You Probably Don't Need CRDTs
## The CRDT Hype Machine Local-first architecture is the gold standard for mobile software development. Instant optimistic updates, zero network spinners, and complete offline capability turn good apps into world-class mobile experiences. When users tap a button, the UI should update in fewer than 16 milliseconds—before any packet hits a cell tower. However, the developer community has developed an unhealthy obsession with Conflict-Free Replicated Data Types (CRDTs). Technical blogs make it seem that unless you are running a state-based Yjs or Automerge engine inside your React Native or Swift runtime, you are building an inferior product. This is a critical architectural mistake. For 95% of mobile applications—inventory managers, productivity trackers, note tools, internal enterprise tools, and e-commerce apps—CRDTs introduce crushing memory overhead, complex serialization costs, and massive tombstone bloat. You do not need dynamic collaborative text editing for structured entity models. You need a rock-solid, trigger-driven SQLite synchronization engine. ## The True Cost of CRDTs on Mobile Devices CRDTs were invented to solve peer-to-peer, simultaneous, multi-user concurrent character edits (like Google Docs or Figma). They solve this mathematically by tracking causal history: every character inserted or deleted requires a unique actor ID, a Lamport timestamp, and an immutable history node. On mobile devices with constrained RAM and battery budgets, this introduces severe performance bottlenecks: * **Memory Consumption:** Storing raw operational logs causes your storage footprint to balloon to 5x–10x the size of the underlying data. * **Garbage Collection Pressure:** Parsing deep conflict graphs in JavaScript or low-memory Native threads triggers micro-stutters and dropped frames during scroll operations. * **Schema Migration Nightmares:** Migrating a CRDT document structure across twenty mobile releases without breaking historical causal graphs is an engineering nightmare. Unless your users are actively typing into the *exact same string field* in the *exact same millisecond*, you do not have a CRDT problem. You have an entity synchronization problem. ## The Pragmatic Alternative: LWW with Change-Tracking Triggers Instead of offloading state management to external sync libraries, use the most reliable piece of software on the planet: SQLite. It runs natively on iOS and Android, processes queries in microseconds, and handles relational constraints flawlessly. By combining a Last-Write-Wins (LWW) conflict strategy with native SQLite triggers, you can build an offline sync engine that is both bulletproof and incredibly fast. ```sql -- Create sync tracking table CREATE TABLE IF NOT EXISTS sync_change_log ( id INTEGER PRIMARY KEY AUTOINCREMENT, table_name TEXT NOT NULL, record_id TEXT NOT NULL, operation TEXT NOT NULL CHECK (operation IN ('INSERT', 'UPDATE', 'DELETE')), timestamp INTEGER NOT NULL, synced INTEGER DEFAULT 0 ); -- Attach trigger to track local mutations instantly CREATE TRIGGER IF NOT EXISTS trg_documents_update AFTER UPDATE ON documents FOR EACH ROW BEGIN INSERT INTO sync_change_log (table_name, record_id, operation, timestamp) VALUES ('documents', NEW.id, 'UPDATE', strftime('%s', 'now') * 1000); END; ``` Every time your application code issues standard SQL updates locally, SQLite tracks the mutation automatically inside an append-only audit log. The user interface updates instantly from local storage, completely decoupled from network latency. ## Server Reconciliation Without Vector Clocks When connectivity returns, syncing this log to the cloud requires a lightweight three-step handshake: 1. **Push Local Changes:** The client sends un-synced entries from `sync_change_log` to an ingest endpoint. The server executes these within a single database transaction. 2. **Apply Field-Level Resolution:** If a client record has an updated timestamp older than the server's last-modified record, the server applies field-level Last-Write-Wins. Only mutated fields overwrite the record; untouched columns remain intact. 3. **Pull Changes:** The server responds with all updates that occurred after the client's last-known `sync_checkpoint_id`. The client inserts the new state into SQLite and updates its checkpoint index in one atomic transaction. ### The Operational Reality By leveraging SQLite directly, your storage overhead drops from hundreds of megabytes of CRDT histories down to a few kilobytes of binary log data. Deletes are clean, migrations are simple standard SQL scripts, and your sync engine runs in pure native code without external dependencies. Stop over-engineering your mobile data layer. Embrace SQLite, ditch the academic sync graphs, and ship applications that feel instantaneous.
mobile architecture
sqlite
local-first
react native
Share X LinkedIn

What clients say

Real reviews from founders and teams we've shipped with.

5.0 · 6 reviews
"Our mobile app in React Native + Expo shipped to both stores in a week. Reviews are glowing."
Diego A.
Founder, Kite Health
"Hashim's team owns delivery end-to-end. Weekly demos, tight scope, no surprises. Best partner we've hired."
Jonas E.
COO, Beacon Labs
"Hashim rebuilt our checkout in a weekend and conversions jumped 34% the following week. Unreal."
Ethan R.
Head of Growth, Shopstack
"Migrated our monolith to a modern edge stack with zero downtime. The playbook was flawless."
Priyanka N.
VP Engineering, Fintrail
"Applications, funnels, and dashboards — everything integrated seamlessly. Enrollments doubled."
Dr. Faisal A.
Director, BLR Admissions
"Design, engineering, growth — Hashim's team owned every layer. We finally look enterprise."
Arjun P.
COO, Bangalore Stays