After watching the talk we picked apart Linear's minified code to better understand the structure and then jumped on a call with Tuomas where he kindly filled any holes in our understanding.
Initially we tried to use IndexDB to give us more of the local-first features by caching between loads, but it was more hassle than it was worth. Instead we settled on live queries using Hasrua (we were a very early user / paying customer). We preload all the data that the user is going to need on app boot and then selectively load large chunks as they open their projects. These are then keeping mobx models up to date.
For mutating data we have a simple transaction system that you wrap around models to update them. It records and sends the mutations and makes sure that outstanding mutations are replayed over model changes locally.
We're not very "local-first" feature-wise; we don't handle conflicts perfectly, really relying on the fact that people are online and receive updates quickly. In practice it works.
Most importantly developers get a familiar graph of objects locally that they can just manipulate and not think about:
project.name = 'New name'
project.save()
PS https://www.countfire.com (always looking for UK based devs to join the team)EDIT Love your design work on Linear, Karri. You guys have made such an amazing product.
Our co-founder did talk about sync engine back in 2020 and recently did updated talk about scaling it [3]. The scaling has definitely taken lot of work and optimizing as datasets for company wide workspace with potentially thousands of users ands object they created can become quite large.
1: https://linear.app
2: https://www.youtube.com/watch?v=WxK11RsLqp4&t=2169s
3: https://linear.app/blog/scaling-the-linear-sync-engine