This presentation advocates for sync engine architectures in local-first applications as the next frontier in frontend development, moving beyond imperative data fetching. It explores how extending reactivity to the server, using systems like Electric and TanStack DB, enables instant, collaborative, and agentic applications by abstracting network complexities and providing declarative data bindings. The architecture addresses challenges in real-time collaboration, offline support, and scaling agentic systems by keeping client and server data consistently synchronized.
Read original on InfoQ ArchitectureTraditional web development relies heavily on imperative data fetching, where applications manually request data from servers. This approach introduces significant latency due to network round trips, leading to loading spinners and a suboptimal user experience. The presentation argues that the next major improvement in application speed and responsiveness comes from extending client-side reactivity all the way to the server, effectively abstracting away the network with a "sync engine" architecture.
In a sync-based model, local writes on the client are instantly applied as optimistic state, allowing the UI to re-render immediately. These changes then synchronize with the server in the background. Conversely, any relevant changes originating from the server (either from the same user or other collaborators/agents) are pushed back to the client, updating the local store and view. This creates an end-to-end reactive data flow.
While WebSockets enable real-time communication, their operational complexity often makes teams hesitant to adopt them for mission-critical applications. HTTP requests are stateless, easier to instrument, debug, and scale horizontally. WebSockets, conversely, introduce state management challenges on the server, impacting memory consumption and debugging in scaled environments. Building a robust sync engine on WebSockets often requires significant engineering investment, historically undertaken by companies with dedicated, highly skilled teams (e.g., Figma, Linear, Notion).
Complexity of Sync Engines
Implementing a full-featured sync engine, especially with advanced capabilities like Conflict-free Replicated Data Types (CRDTs) or incremental view maintenance, involves deep distributed systems expertise and significant innovation tokens. This has historically been a barrier for most development teams.