本文由 AI 分析生成
建立時間: 2026-03-28 來源: https://bytemash.net/posts/i-went-down-the-linear-rabbit-hole/
Summary
Developer exploration of local-first architecture triggered by Linear’s impossibly fast UX. Covers the local-first paradigm (local DB as primary, server as sync peer), the ecosystem (Jazz, Electric SQL, Zero, PowerSync, etc.), and a hands-on evaluation of Jazz with honest trade-offs (event sourcing forces permanent storage, E2E encryption blinds the server, GDPR complications).
開發者因 Linear 極快的 UX 而探索本地優先架構。涵蓋本地優先範式(本地 DB 為主,服務器為同步對等節點)、生態系統(Jazz、Electric SQL、Zero、PowerSync 等),以及對 Jazz 的實踐評估,誠實指出其取捨(事件溯源強制永久存儲、E2E 加密使服務器失明、GDPR 複雜化)。
Key Points
- Local-first pattern: client has its own database; UI updates happen immediately (local read/write); sync happens async in background → eliminates network latency from user interaction path
- Linear’s architecture: IndexedDB as local DB + GraphQL mutations + WebSockets for sync; CTO Tuomas Artman’s talks are authoritative sources
- Architecture inversion: traditional (server is source of truth) → local-first (each client has near-complete DB; server is another sync peer)
- Ecosystem landscape (2025): Jazz, Electric SQL, Zero, PowerSync, Triplit, Instant, Dexie Cloud, LiveStore
- Jazz deep dive: CoValues (collaborative data structures), event sourcing, E2E encryption, group-based permissions;
post.title = titlejust syncs — no API routes needed - Jazz trade-offs: event sourcing = nothing is ever deleted → GDPR problem, storage grows unboundedly; E2E encryption = server can’t access user data (good for privacy, bad for moderation/analytics)
- When local-first fits: creative tools, collaborative apps, mobile offline, developer tools. Challenging: heavy server-side business logic, strict audit requirements, large analytics
Insights
The “architecture inversion” framing is the clearest explanation of what makes local-first different: moving source-of-truth from server to client changes which operations are fast (local writes are instant) and which are complex (conflict resolution, partial sync). Jazz’s post.title = title abstraction is remarkable for DX — it hides CRDTs, sync, and networking behind a simple assignment. The trade-offs section is unusually honest: the Jazz author’s dev experience story (Passkeys + HTTPS + mkcert on LAN) illustrates how early-stage the tooling is. Electric SQL and Zero represent the more incremental path (Postgres-backed) for teams with existing infrastructure.
Connections
Raw Excerpt
By moving the database to the client, you eliminate network latency from the user interaction path. Updates happen instantly because they’re just local database read/writes. The key point is that the server becomes just another client to sync with.