TL;DR
Linear’s speed stems from its innovative local-first database approach, using IndexedDB in the browser, and a custom sync engine that eliminates network delays. This results in near-instant updates, setting it apart from traditional web apps.
Linear can update issues in less than a millisecond, a feat achieved through its unique architecture that leverages a local database in the browser and a custom sync engine, setting a new standard for web app responsiveness.
According to insights from developer Dennis Brotzky and observations from Linear’s public communications, the core of Linear’s speed lies in its use of IndexedDB as the primary data store within the browser. This approach allows for immediate local updates, which are reflected instantly in the UI without waiting for network responses. When a user modifies an issue, the change is applied directly to an in-memory observable (using MobX), and the sync engine batches these changes for asynchronous transmission to the server. This design eliminates typical network latency from the user experience, making updates feel instantaneous.
Linear’s sync engine is a bespoke system that queues mutations locally and applies them immediately to the UI, then asynchronously pushes these changes to the backend. This method contrasts with traditional CRUD apps, where each update involves a network request that can take hundreds of milliseconds, causing UI delays and spinners. By decoupling the UI response from network latency, Linear provides a seamless, native-like experience.
The stack supporting this architecture is intentionally simple, comprising React, TypeScript, MobX, PostgreSQL, and a CDN, with no reliance on complex edge databases or server-side rendering. The app also employs optimistic updates, where local changes are immediately reflected and only rolled back if the server reports an error, further enhancing perceived speed.
Why It Matters
This approach significantly improves user experience by making interactions feel instantaneous, which can increase productivity and user satisfaction. It also demonstrates a shift toward local-first web app architectures that prioritize responsiveness over traditional server-centric models. For developers, understanding Linear’s architecture offers a blueprint for building highly responsive applications, especially in collaborative or issue-tracking contexts where real-time updates are critical.
IndexedDB browser storage device
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Background
Linear launched with a focus on performance, and its architecture has been shaped by a deliberate choice to prioritize local data handling. The concept of a local database in the browser is not new but is rarely implemented at this scale for real-time collaborative apps. Prior to this, most web apps relied heavily on server round-trips, which introduced latency and UI delays. Linear’s approach reflects a broader trend toward edge computing and local-first data models, but with specific optimizations for speed and simplicity. Their decision to build a custom sync engine from day one distinguishes them from competitors that rely on third-party libraries, aiming for maximum control over performance.
“The secret to Linear’s speed is the database in the browser, using IndexedDB, and a custom sync engine that batches and asynchronously updates the server.”
— Dennis Brotzky
“Literally the first lines of code I wrote were the sync engine, which is very uncommon for startups.”
— Tuomas, Linear co-founder
local-first database for web apps
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
What Remains Unclear
It is still unclear how Linear manages data consistency and conflict resolution across multiple clients in real-time, or how scalable this approach is under heavy load. Specific implementation details of their sync engine remain proprietary and are not publicly documented.
custom sync engine software
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
What’s Next
Further technical disclosures from Linear may reveal more about their sync engine and data consistency strategies. Observers expect updates on how the architecture performs at scale and how it might be adapted for other applications seeking similar responsiveness.
React TypeScript development tools
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Key Questions
How does Linear’s local database improve performance?
By storing data in IndexedDB within the browser, Linear allows immediate local updates that are reflected in the UI without waiting for network responses, drastically reducing latency.
What is the role of the custom sync engine?
The sync engine batches local mutations and asynchronously pushes them to the server, enabling near-instantaneous UI updates and background synchronization.
Can other apps replicate Linear’s speed?
While libraries like Tanstack Query and SWR can approximate similar responsiveness with optimistic updates, Linear’s custom architecture is tailored for maximum speed and may be challenging to replicate exactly without similar design decisions.
Does this architecture affect data consistency?
The approach relies on background synchronization and conflict resolution strategies, but specific details about how data consistency is maintained across multiple clients are not publicly disclosed.
Is this approach scalable for large teams or complex data?
Scalability at high concurrency levels remains to be tested; current information suggests the architecture is optimized for responsiveness rather than massive-scale data distribution, but further insights are expected as Linear grows.
Source: Hacker News