4 ms·
We built LegendKeeper using Yjs! (It's a mapping app as well, but fantasy). Ended up rolling our own sync server to handle large scale multiplexing, as we have
by braden-lk 2y ago
We built LegendKeeper using Yjs! (It's a mapping app as well, but fantasy). Ended up rolling our own sync server to handle large scale multiplexing, as we have D&D game-masters with 25,000+ documents to manage. (I don't know how they do it, tbh!)
We opt for the central server as a super-peer and use the Yjs differential update system to avoid loading docs in memory for too long. While there are many things about local-first that are a huge pain in the ass, the UX benefits are pretty huge. The DX can be nice too! Getting to focus on product and not on data transit (once you've got a robust sync system) is pretty sweet. The first 4 weeks of launching our Yjs-based system was rough though; lots of bugs that virally replicated between peers. It requires a really paranoid eye for defensive coding; after several years, we have multiple layers of self-healing and validation on the client.
- jakelazaroff 2y agoI think a lot of people — including myself — would be very interested in a longer write-up of that system if you're ever interested in sharing more :)
- necrodome 2y agoI feel like we’re on the verge of seeing the start of a whole new wave of local-first apps (and "personal software" as mentioned here https://x.com/rauchg/status/1840293374059839726 https://x.com/rauchg/status/1840293374059839726), but we’re really missing Rails-like frameworks that offer a complete package for development. Something that gives you all the tools you need—from syncing, conflict resolution, state management, authorization, background jobs in the context of local-first to deployment—without having to reinvent the wheel. I built a simple SaaS [1] to get a sense of what's missing and while React Router + a syncing local first database [2] + $5/month Cloudflare gets you pretty far, I still found myself needing to think through a lot of pieces [1] https://usequickcheck.com/ https://usequickcheck.com/ [2] https://fireproof.storage/ https://fireproof.storage/
- halfcat 2y agoZero [0] is coming, from the people that made Replicache [0] https://zerosync.dev/ https://zerosync.dev/
- ForHackernews 2y agoThis seems to be a local cache, not a local-first data store?
- halfcat 2y agoYes, Replicache is more the local-first solution, if you’re going for offline-capable with eventual data sync. But requires some work to integrate your API, and thinking about how to do conflict-free updates with your API. I haven’t gotten my hands on Zero yet, but the gist I get from those who have is that it gives you the same kind of experience with less work, where the client just operates from the local cache, and I’d assume there will be some way of lazy loading the entire data set into the cache which would give you offline capabilities if desired, but still functions as a traditional web app if the data set is too large.
- raybb 2y agoThis sounds so fantastic. Thanks for sharing. I wonder how well it'll be able to incorporate into existing apps vs making new ones from scratch. I've been using Splitt.app a lot lately while traveling and it drives me nuts that it doesn't have better offline/low data support. I'd like to improve it but haven't dug into the site yet to see what it would take.
- josephg 2y agoOh fascinating! I'd love to read more about what worked well & poorly when building LegendKeeper on top of Yjs. What features do you wish Yjs had that would make your life easier?