Introduction
Linear is often praised for its speed and efficiency. When you compare the time it takes to update an issue in Linear with a traditional CRUD application, the gap is evident: mere milliseconds versus around 300 ms. So, how does Linear manage to be so fast? Let's dive into the technical decisions that make this possible.
Database in the Browser
Most web apps follow a classic pattern: the user interacts, an HTTP request is sent, a server queries a database, and the response is sent back to the client. Linear flips this relationship. The database that the user interface reads from is in the browser, utilizing IndexedDB.
This approach allows mutations to apply locally before being asynchronously pushed to the server. The server then sends deltas back to other clients via WebSocket, significantly reducing the need for time-consuming network requests.
Making the First Load Feel Instant
Linear ensures that even the first user interaction feels instant. This is achieved by preloading critical data and using progressive rendering techniques that minimize visible load times.
The Sync Engine
Linear employs a sophisticated sync engine that batches transactions. This means changes are first recorded locally and then synchronized with the server, thus reducing wait times and eliminating loading states.
Design Optimized for Speed
Linear's design is minimalist and optimized for maximum performance. Animations are smooth and intentional, contributing to the overall impression of speed. They are designed to be lightweight, using techniques like hardware acceleration to ensure optimal performance.
Conclusion
Linear's speed is not a coincidence but the result of thoughtful architecture and continuous optimizations. By adopting these techniques, other developers can also enhance the performance of their applications.
Let's discuss your project in 15 minutes.