Local-First Foundations
Brian Hicks, January 22, 2025
I'm writing a book about local-first software tentatively called Local-First From Scratch. This is a snippet from that book—an intro to why you should care about local-first software and what it gets you. I thought it ended up being a pretty good summary of what the whole project is about, so I wanted to share it as a blog post as well!
If you picked up this book, you might have some idea about what "local-first" means, but let's get on the same page: other than "works offline", what are we aiming for?
In short, local-first software moves ownership of data from "somewhere in the cloud" to your local devices.
This has a bunch of consequences. We like some of them:
- Updates are practically instant because the network does not have to be involved. No loading times or spinners! You can also work completely offline.
- You are in control of your data and control who gets access to it.
- A company going through an "incredible journey" acquihire doesn't mean you lose access to your work.
Of course, implementing these ideas is a little harder than just storing data in a local SQLite database. There's a cost paid in complexity and figuring out new ways of doing things. For example, we'd typically enable sharing by having a central server hold all the state. But we can't do that if the user is offline and can't reach the server So local-first also raises some questions we need to answer:
- You probably have more than one device (phone, computer, etc.) Which one is the "real" copy?
- If you want to share your work with someone else, how?
- When you share—either with other devices or other people—how do you avoid conflicting writes?
We want satisfying answers to these without giving up local control. The typical approach—and the one we'll implement in this book—is CRDTs.
That's it for the preview. Keep an eye out for the book hopefully later in 2025!