SyncedStore
corrosion
SyncedStore | corrosion | |
---|---|---|
7 | 5 | |
1,622 | 595 | |
- | 2.4% | |
4.6 | 9.4 | |
2 months ago | 3 days ago | |
TypeScript | Rust | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
SyncedStore
-
Local-first software: You own your data, in spite of the cloud (2019)
This article has been quite the inspiration for many projects and progress on this front. I think we're seeing more and more developments around CRDTs and local-first frameworks / applications.
I'm working on a few projects in this area:
- https://www.typecell.org - Notion meets Notebook-style live programming for TypeScript / React
- https://www.blocknotejs.org - a rich text editor built on TipTap / Prosemirror that supports Yjs for local-first collaboration
- https://syncedstore.org - a wrapper around Yjs for easier development
In my experience so far, some things get more complicated when building a local-first application, and some things get a lot easier. What gets easier is that once you've modeled and implemented the data-layer (which does require you to rethink / unlearn a few principles), you don't need to worry about data-fetching, errors etc. as much as in a regular "API-based" app.
Another interesting video I recommend on this topic is about Linear's "Sync Engine" which employs some of the local-first techniques as well: https://www.youtube.com/watch?v=Wo2m3jaJixU
- SyncedStore - build CRDT-powered collaborative Vue apps for the web
- SyncedStore - build CRDT-powered collaborative React apps for the web
- SyncedStore - build multiplayer CRDT-powered collaborative apps for the web
-
Show HN: SyncedStore CRDT – build multiplayer collaborative apps for React / Vue
Hi! Great questions :)
First of all, SyncedStore does not implement any CRDT algorithms. Credits for this go to Yjs [1] (and its author Kevin), which it uses as underlying CRDT.
Yjs and Automerge are (afaik) the two most commonly used CRDT implementations. Both have their pros and cons, but Yjs has focused a lot on performance [2].
Automerge has a bit friendlier "Immer style" [3] API. I'm not too familiar with @localfirst/state, but it seems to add a Redux style API on top of Automerge.
My approach with SyncedStore was really to provide an API on top of Yjs that's as simple as possible to use in React / Vue / Svelte or plain JS app. I.e.: only use a single React Hook to observe changes, and use regular Javascript assigments to update values. The API is inspired mostly by Reactive Programming libraries such as MobX [4] (from the same author as Immer).
Hope you're still following along :) Maybe it helps to compare the TODO-MVC applications, as both SyncedStore (https://github.com/YousefED/SyncedStore/tree/main/examples) and @localfirst/state (https://github.com/local-first-web/state/tree/main/examples/...) have implemented these as examples!
[1]: https://github.com/yjs/yjs
-
Web Applications from the Future: A Database in the Browser
I’m exploring the ideas (an easy to use framework to build local-first [1] apps) in my library Reactive-CRDT (https://github.com/yousefed/reactive-crdt). Feedback welcome!
All credit for the underlying tech to YJS, which has been amazing as mentioned by others in this thread.
[1]: https://www.inkandswitch.com/local-first.html
corrosion
-
Local-first software: You own your data, in spite of the cloud (2019)
Couchdb/pouchdb remains one of the best: it's super easy to setup and is production-ready, but it's gonna be json docs with no transactions, so it can be limiting.
Y.js and automerge emerged as solutions combining CRDTs and content transfer, they look really promising. There is a Y.rs version if that's better for you.
I've always dreamt of building something on top of Syncthing, ie something that would use file synchronization. It's more versatile and will definitely last longer than anything else, and it has some built-in capabilities for having a third party helping transport but not being allowed to read content.
I recently came across https://github.com/superfly/corrosion , a service discovery and state management tool that is working completely p2p. CR-SQLite, in particular, allows multiple tables from multiple databases to be merged thanks to CRDTs. I'm sure there's a lot to build on top of it.
I feel like you're not really interested in full p2p but want some centralization point to manage some auth stuff, so I'd investigate couchdb/pouchdb first.
-
ClickHouse Keeper: A ZooKeeper alternative written in C++
Any thoughts here on Fly's Corrosion? https://github.com/superfly/corrosion
-
I'm All-In on Server-Side SQLite
We’re using cr-sqlite as part of our distributed state propagation system. It is indeed easy to bundle in the app!
https://github.com/superfly/corrosion
It would be possible to distribute cr-sqlite changes in many different ways (like you said, http or torrents, etc.) since any change can be applied out of order.
- Corrosion: Gossip-based service discovery for large distributed systems
- Corrosion: Gossip-based service discovery (& more) for large distributed systems
What are some alternatives?
FluidFramework - Library for building distributed, real-time collaborative web applications
TypeCell
RxDB - A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/
greptimedb - An open-source, cloud-native, distributed time-series database with PromQL/SQL/Python supported. Available on GreptimeCloud.
automerge - A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.
socket - A cross-platform runtime for Web developers to build desktop & mobile apps for any OS using any frontend library.
adama-lang - A headless spreadsheet document container service.
litestack
Immer - Create the next immutable state by mutating the current one
sqlite-migrate - A simple database migration system for SQLite, based on sqlite-utils
osmosis-js - JS reference implementation of Osmosis, a JSON data store with peer-to-peer background sync
cr-sqlite - Convergent, Replicated SQLite. Multi-writer and CRDT support for SQLite