Some notes on local-first development
As someone who has been doing local-first for the last 3 years with Notesnook, let me tell you: it&#x27;s not all gardens and roses. Local first has its own very unique set of problems:<p>1. What to do with stale user data? What happens if a user doesn&#x27;t open the app for a year? How do you handle migrations?<p>2. What about data corruption? What happens if the user has a network interruption during a sync? How do you handle partial states?<p>3. What happens when you have merge conflicts during a sync? CRDT structures are not even close to enough for this.<p>4. What happens when the user has millions of items? How do you handle sync and storage for that? How do you handle backups? How do you handle exports?<p>One would imagine that having all your data locally would make things fast and easy, but oh boy! Not everyone has a high end machine. Mobiles are really bad with memory. iOS and Android have insane level of restrictions on how much memory an app can consume, and for good reason because most consumer mobile phones have 4-6 gbs of RAM.<p>All these problems do not exist in a non-local-first situation (but other problems do). Things are actually simpler in a server-first environment because all the heavy lifting is done by you instead of the user.