Reverse engineering of Linear's sync engine

by flashblazeon 5/29/2025, 4:29 AMwith 33 comments

by artmanon 5/31/2025, 12:02 PM

I think the impressive part here isn't Linear's sync engine, but the fact that Evan Hu went through painstakingly reverse-engineer the engine by inspecting traffic and obfuscated code and was able to write documentation that is correct and more complete than what Linear publishes internally.

by jtwalesonon 5/31/2025, 1:17 PM

I have a first attempt at a sync engine for my app, but it's very primitive. Just a websocket that sends updates based on database triggers. If you miss one, you have to do a full reload. I know I'll need something better in a year or so.

Any advice on what route to take with creating a sync engine for a product like mine? Self-hosted, single binary web app (Rust) + Postgres db. Frontend is based on VueJS. I've looked at the readme of Yjs and was considering that. I'm a solo dev for now.

I'm tempted to feed Cursor this description of the reverse engineered solution of Linear, but I doubt it'll be successful.

by devmakasanaon 5/31/2025, 8:31 AM

Linear’s sync engine maintains a local, in-memory object graph (backed by MobX) and persists all changes to IndexedDB, allowing immediate, offline-first updates.

We build same experience at www.teamcamp.app

by bitpushon 5/31/2025, 5:54 AM

What's the closest opensource library that implements this sync (or similar) scheme? ElectricSQL? ZeroSync? Firebase? Something else?

by nologic98on 5/31/2025, 2:06 AM

Is this applicable for a consumer mobile app to use for a local-first architecture (either conceptually or literally)?

by tonethemanon 5/31/2025, 1:52 AM

Whatever a linear sync engine actually is... sigh. Needs more information.

by mappuon 5/31/2025, 4:18 AM

If you're using AI to write all those em-dashes, please add a disclaimer.

For humans i would say a shorter summary is Linear.app syncs a client IndexedDB with the server using naive last-write-wins, no conflict detection, no OT, no CRDT. There's a global sync ID that the server is in control of. Most of the article describes minutae of the json schema.