What a sync engine is, and when you need one

A sync engine keeps a copy of your data on each device and reconciles it with the server. Screens render at once, edits work offline, and every client ends up in the same state.

How it works

Most apps fetch data when a screen opens and show a spinner until it arrives. Every read is a round trip, and a dropped connection is an error. A sync engine flips that. The device holds a copy of the data, the interface reads and writes that copy, and a background process reconciles it with the server.

Two pieces do the work: the local copy, usually IndexedDB or SQLite, and the rule for what happens when your copy and the server’s disagree. Offline support and real-time updates both fall out of those two.

Why teams want one

Not for real-time, though that comes free. For speed and for offline. Reading from a local copy takes microseconds, so screens stop having a loading state. Writing to it means someone on a train keeps working through the tunnel and their edits land when signal returns.

Two ways to resolve conflicts

CRDTs build the merge into the data itself. Clients that see the same edits in any order reach the same state, with no coordinator. The cost is metadata on every value, and awkwardness once you need partial replication or per-row permissions.

A server-ordered log gives one server the final say. It numbers every change, clients replay that order, and pending writes are rebased on top of whatever arrived while they were behind. Permissions and partial replication come from the same mechanism. This is what Linear described and what Strata Sync implements.

Text is the exception. Two people typing in one paragraph is the case a single ordering handles badly, so even log-based engines use a CRDT for rich text.

When you should not use one

  • One person writes each record and nobody else reads it at the same time.
  • The data per user is large and mostly cold.
  • Your data is computed server-side and nothing is written back.
  • The network is reliable and a spinner is acceptable.

A sync engine is a data-model decision, not a dependency. Every synced type needs a stable id, a conflict rule and a decision about who can see it, and the local store becomes a schema you migrate. Those costs do not go away, so the benefit has to earn them.

Next

To see the mechanism rather than read about it, how a sync engine works builds one from a single checkbox, in figures you operate yourself.

If the server-ordered approach sounds right, read the sync protocol. If you are choosing between projects, the comparison guide covers Zero, ElectricSQL, Convex, InstantDB and PowerSync.

Common questions

Get started

One command. It scaffolds a working app with the sync server wired up.

npx stratasync init my-app
Read the docs

Keep reading