linear.app · Free post · Execution, roadmaps & process · Metrics, data & experimentation

Rebuilding Linear’s delta sync read path

LinearAug 18, 20266 min
Sourcelinear.app
KindFree post
PublishedAug 18, 2026
Originallinear.app ↗
N:

Linear rebuilt its delta sync read path to handle massive scale—workspaces generating ~1M sync actions daily. The old Postgres approach struggled with permission-aware set intersections across 20TB+ of data, causing volatile tail latency. By adopting turbopuffer's inverted indexes, Linear now serves delta queries using posting lists instead of scanning candidate rows, keeping latency flat and predictable even as workspaces grow. The two-stage pipeline (metadata scan + late enrichment) reduces I/O and JSON processing while maintaining correctness through hybrid Postgres/turbopuffer serving.

01Key takeaways

  • Storing a change log and serving a change log are different problems requiring different infrastructure and optimization strategies.
  • Inverted indexes with posting lists excel at permission-aware set intersections; row-by-row filtering doesn't scale for large permission/subscription sets.
  • Late enrichment—filtering metadata first, then fetching full payloads—reduces I/O and memory for queries that reject many candidates.
  • Hybrid serving (Postgres + secondary index) with deduplication tolerates replication lag and provides graceful fallback without sacrificing correctness.
  • Shadow mode validation is critical for correctness-sensitive paths; faster queries only matter if they return exactly the right results.
  • Tail latency predictability matters more than median latency for user experience, especially at scale with large workspaces.

02Key sections

Delta sync fundamentals
Linear clients maintain local databases and sync changes via checkpoints. Delta sync retrieves only new actions since the last checkpoint, filtered by user permissions and subscriptions. At scale, this becomes a massive set intersection problem across millions of daily sync actions.
Why Postgres hit limits
The previous read path used a dedicated Postgres table but struggled with widening ID ranges combined with array-overlap predicates. CPU spent testing and discarding irrelevant rows, causing volatile tail latency that read replicas couldn't fix. Fundamental query shape needed to change, not just tuning.
Inverted indexes and posting lists
turbopuffer maintains sorted ID lists (posting lists) for each filterable attribute. Instead of scanning candidate rows, the query unions posting lists for sync groups and subscriptions, then intersects with the requested ID range. This transforms the problem from row-by-row testing to direct set operations.
Two-stage read pipeline
Metadata scan returns lightweight routing data to filter sync actions; only surviving actions are enriched with full payloads from Postgres. Late enrichment avoids expensive JSON decoding and I/O for actions that would be rejected by access checks or subscription filters.
Hybrid serving and replication safety
Postgres serves the most recent sync actions (authoritative), turbopuffer serves historical range. Overlapping ranges with deduplication tolerates replication lag. Fallback to Postgres if turbopuffer is unavailable. Shadow mode validated correctness before production rollout.
Predictable latency at scale
Postgres path showed increasing p95/p99 latency as workspaces grew; turbopuffer's posting-list approach kept tail latency flat. Largest customers benefit most—reconnection speed no longer degrades as sync action volume increases.
“Storing a change log and serving a change log are different problems.”Linear · linear.app
“Delta sync is a correctness-critical path; a faster query is only useful if it returns exactly the sync actions the client is supposed to receive.”Linear · linear.app

03Frameworks mentioned

Summary and takeaways written by PM Atlas; quotes are short excerpts. © the original author.