# Local-First Software Local-first software is a way of building applications where the primary copy of your data lives on your own device, not on a company's servers. The app works offline, feels instant, and syncs with other devices or collaborators when a connection is available. The cloud becomes a helper, not the owner of your data. The term comes from a 2019 essay by Martin Kleppmann, Adam Wiggins, Peter van Hardenberg, and Mark McGranaghan at Ink & Switch: "Local-First Software: You Own Your Data, in spite of the Cloud". Their starting point was a frustration most of us share. Cloud apps like Google Docs made collaboration easy, but they took something away: if the service is slow, you wait. If you're offline, you're stuck. If the company shuts down or changes its terms, your work goes with it. Local-first tries to keep the collaboration and multi-device convenience of the cloud, while giving back the speed, privacy, and ownership of old-school desktop software. ## The seven ideals The Ink & Switch essay defines local-first through seven ideals: 1. **No spinners.** Data is on your device, so reading and writing is instant. No round trip to a server for every action 2. **Your work is not trapped on one device.** Data syncs across your laptop, phone, and tablet 3. **The network is optional.** Everything works offline; changes sync when you reconnect 4. **Seamless collaboration.** Multiple people can edit the same data, in real time or asynchronously, and changes merge cleanly 5. **The Long Now.** Your data outlives the app and the company that made it. You can still open your files in 20 years 6. **Security and privacy by default.** Data stays on your devices; when it has to travel through servers, end-to-end encryption keeps it private 7. **You retain ultimate ownership and control.** You can copy, modify, export, or delete your data whenever you want. No vendor lock-in Most apps only tick a few of those boxes. Plain files on disk nail ownership, speed, and longevity, but make collaboration hard. Cloud apps nail collaboration, but fail on ownership and offline use. The hard part is getting all seven at once. ## Local-first vs cloud-first | Aspect | Local-first | Cloud-first | |--------|-------------|-------------| | **Where the data lives** | Your devices | Company servers | | **Offline** | Full functionality | Limited or none | | **Speed** | Instant | Depends on the network | | **Ownership** | You | The provider | | **Longevity** | Survives the app | Dies with the service | | **Privacy** | Stays local by default | Provider can access it | | **Collaboration** | Possible, via sync | Built in | | **Complexity for builders** | Higher (sync is hard) | Lower (one central database) | ## How sync works without a central server The hardest problem is merging changes made on different devices at the same time. The main answer is **CRDTs** (Conflict-free Replicated Data Types): data structures designed so that edits made independently can always be merged automatically, in any order, and every device ends up with the same result. For example, if you type "Hello World" on your laptop while offline, and "Hello!" on your phone, a CRDT-based text editor merges both into "Hello World!" once the devices reconnect, without asking you to resolve a conflict and without a server deciding who wins. Common building blocks: - **Automerge** and **Yjs**: CRDT libraries for building collaborative local-first apps - **[[SQLite]]**: the go-to local database, increasingly paired with sync engines - **IndexedDB**: local storage inside web browsers - **libp2p**: peer-to-peer networking, when you want devices to sync directly ## The trade-offs Local-first isn't free: - **Sync is hard to build.** Conflict handling, schema changes, and partial sync add real complexity, even with good libraries - **Storage is limited** by the device, so large datasets need selective sync - **Backups become your job**, unless the app offers optional cloud backup - **Access control is harder** without a central server enforcing permissions For many personal tools, though, the simplest version of local-first is enough: plain files on disk, synced with a tool like [[Syncthing]]. ## My take - This is one of the reasons I love [[Obsidian]]. My notes are Markdown files on my own disk. The app is fast, works offline, and if Obsidian disappeared tomorrow, I'd still have everything. That's the [[File over app principle]] in action - [[Logseq]] follows the same approach, and even cloud-native products like [[Linear]] keep a local copy of your data to feel instant - I default to local-first for the tools I build for myself. [[Knowii Voice AI]] runs entirely on my computer, with no cloud. For [[Software for One]], it also means less infrastructure to pay for, secure, and maintain - Local-first is [[Data Sovereignty]] by construction: nobody can take your data away if it never left your hands ## References - Kleppmann, M., Wiggins, A., van Hardenberg, P., McGranaghan, M. (2019). "Local-First Software: You Own Your Data, in spite of the Cloud" - https://www.inkandswitch.com/local-first/ - https://crdt.tech/ ## Related - [[File over app principle]] - [[Data Ownership]] - [[Data Sovereignty]] - [[Sovereign AI]] - [[Offline-First]] - [[Personal Knowledge Management (PKM)]] - [[Obsidian]] - [[Logseq]] - [[Software for One]] - [[Malleable Software]]