news.volyx.in

How's Linear so fast? A technical breakdown (performance.dev)

497 points by howToTestFE · 82 days ago · 236 comments on HN

Article summary

The article breaks down the technical decisions behind Linear's fast performance, including using a database in the browser, optimistic updates, and a custom sync engine. This approach allows for instant updates and eliminates the need for network requests, making the app feel native and fast. The article also explores Linear's stack, including their use of React, TypeScript, and MobX, as well as their approach to code splitting and caching. By reducing the amount of JavaScript and CSS needed to render the app, Linear achieves fast load times and a seamless user experience.

Main themes

  • Performance optimization
  • Database in the browser
  • Optimistic updates
  • Code splitting and caching
  • Sync engine
  • Client-side rendering

What commenters say

  • The approach of updating the client-side first and syncing in the background can lead to inconsistencies and data loss in case of network failures or conflicts.
  • Optimistic updates can provide a better user experience, but may not be suitable for all applications, especially those requiring strong consistency and reliability.
  • The use of client-side rendering and local storage can be beneficial for performance, but also introduces challenges related to data persistence and synchronization.
  • The article's approach to performance optimization is overly complex and may not be necessary for most use cases, where simpler solutions can achieve similar results.
  • The importance of handling edge cases, such as network partitions and client disconnections, is crucial when implementing optimistic updates and client-side rendering.
  • The trade-off between consistency and availability in distributed systems is a fundamental challenge, and the approach taken by Linear prioritizes liveness over consistency.
  • Explicit feedback mechanisms, such as visual indicators for background syncing, are necessary to ensure a good user experience when using optimistic updates and client-side rendering.
  • The use of browser APIs for local storage and caching can be problematic due to the lack of guaranteed persistence and potential for data loss.