• Building local-first apps seems to be all the rage

  • ...and I really love the idea: By keeping user's data on their device, you can save storage costs, sidestep GDPR trouble, simplify auth management and have a leaner (or no) backend

  • However, the field seems not to be that mature, yet. While it is certainly possible to build within a local-first paradigm with many different tech stacks, few setups work out of the box or without serious drawbacks.

  • Here is my evaluation, from the lens of a solo dev who just wants local storage to work (but that doesn't want to work on local storage)

    • "Tiny" solutions like localStorage or React Native's Async Storage are easy to use and to setup. However, you can't just put giant amounts of data there.

    • Going full native also appears to be a good solution: Something like Electron + fs (or some library), React Native's expo-sqlite or Flutter's sqflite seem really really nice, if you don't care about web support

      • However, I do want the option to simply deploy my stuff to something.com, and I was actually unable to make any of these solutions work while building for web
    • CouchDB/PouchDB seems pretty neat, but the document-based database style is very alien to me

    • ...which is also the problem with my personal winner (by elimination): IndexedDB with Dexie.js on top

      • Using just IndexedDB feels very cumbersome, that's why I like having Dexie on top

      • the most scary thing about this solution is that it appears to be somewhat unclear what the data limits are, what happens if you exceed them, and how persistent your data is...

    • ...which is also the problem with another, very simple solution, which is to use a persistence plugin for the state management library that you are likely using anyways, e.g. pinia-persisted-state for Vue.

      • Here, I'm even less trusting of the persistence being actually persistent
  • Overall, I'd love there to be a zero-config option for local-first data storage, but I haven't found it yet. I will try to build something serious with either Dexie or persistent state, and report back.