TL;DR: When you are building something on top of a p2p network (e.g. Waku), think about making it Local First to improve UX whenever the network is unreliable or unavailable.
I’ve been thinking and talking about local first (https://localfirstweb.dev/) for some time, but mostly in particualar contexts of a particular app or a project. I am no expert on local first development or architecture, but it is something that heavily resonates with me - especially in context of p2p networks.
Early internet apps started as Local First - you’d do things locally and since early on you’d rarely have a 24/7 stable connection, you’d sync your stuff whenever possible - anyone tried Git?
We evolved internet and our tools to be always online and always in sync with everyone else - and we mainly achieved this from the perspective of tools by turning them into services (SaaS) and centralizing them. Turning our fat clients (MS Word) into thin clients (Google Docs/Office 365). It is amazing to have access to your data and services from any device at any point. But there are huge buts.
We all probably understand well enough the risks of relying on centralized services, so this post is not about that - and many centralized services (Google Docs) allow you to work offline and hence “local first” as well.
We build and use peer-to-peer networks and as we established through various experiences in Waku, Status, Codex… p2p networks are inherently unreliable. As much as we’d love to add all the reliability guarantees of centralized systems - we cannot. The only way to overcome this is to always approach our apps as Local First and then realy on p2p network for syncing.
I am absolutely one to blame for not following this approach as well:) Qaku is not local first and will not work without connection to Waku, shame on me! The main reason is my laziness and also that Q&A kinda assumes a live interaction (at least in my head).
But we have another great examples where Local First approach should be very much the go-to mantra - OpChan and WhisperBox. Let’s focuse on OpChan because that is something we need and want to put in front of people.
We should probably consider it in our FURPS (probably in Usability?) to add items specifically talking about “when the network connection is not available, …” - I should be able to read threads that I have already synced from the network, but I should be also able to upvote, reply and create new threads while being offline - the content / messages should be cached and synced with the network when I am reconnected to Waku.
There are also existing libraries and specs which already help with the Local First approach - namely CRDTs - e.g. GitHub - yjs/yjs: Shared data types for building collaborative software is used in Fileverse (ddocs.new) and we could consider integrating Waku (either as a transport for sync or signaling approach to establish direct WebRTC/p2p connection).
Call to action: If you are interested in this, or have an experience with Local First approach, or have an app that you have built with this approach in mind, please do share - apps, insights, libraries, thoughts, coutner-arguments. I believe it would be extremely valuable to know about and leverage Local First in anything we build, but I also might be wrong or missing some key perspective.