Reflect – Multiplayer web app framework with game-style synchronization
31–40 of 159 posts
Re: Reflect – Multiplayer web app framework with game-style synchronization
#32Iw as wondering what kind of checkingpoint or snapshotting there might be. Such that one doesn't have to "replay-the-world" if something goes awry (localstack persistence did/l (does?) this, storing state by just recording/replaying API calls). It sort of seems like having a globally accepted state is enough & makes sense, but it still seems like work to rollback & do again, still seems to require snapshotting.
Something like this feels like a 100% fit for having immutable data structures. Where you can snapshot the world very very quickly/at low cost.
Re: Reflect – Multiplayer web app framework with game-style synchronization
#33This technique is pretty similar to Operational Transformations, except that it requires an authority for serialization and must re-apply any state which is out of sync.
It's not the same thing. OT works by having a discrete set of operations that are known to the system so that they can be reordered properly server-side. Reflect is based on Server Reconciliation: https://www.gabrielgambetta.com/client-side-prediction-serve... . The critical difference is that Reflect doesn't need to know the operations up front. That is what allows developers to provide their own operations, or as w…
Re: Reflect – Multiplayer web app framework with game-style synchronization
#34People might remember this showing up once or twice before as Replicache. Reflect adds a fully managed, incredibly fast sync server. The local-first/realtime space is getting busy these days. Replicache/Reflect is well worth checking out for the beautifully simple data model / coding model. I'm very happy with it. One plus point compared to CRDTs is that you get to decide how you want to deal with conflicts yourself,…
I agree wholeheartedly — we took the same approach for PowerSync with a server reconciliation architecture [1] over CRDTs, which is also mentioned elsewhere in the comments here. For applications that have a central server, I think the simplicity of this kind of architecture is very appealing.
Props to Aaron for bringing awareness to and evangelizing server reconciliation.
[1] https://www.gabrielgambetta.com/client-side-prediction-serve...
Re: Reflect – Multiplayer web app framework with game-style synchronization
#35If you want true concurrency, in an elegant format, with a lot of the common problems abstracted away -- use Erlang. They solved this 30 years ago.
Someone should bring those logics to js and java then. Ehm, please.
https://github.com/untu/comedy
However to the below point, Bolt ons are never as good as baked ins. This is especially true for concurrency.
Re: Reflect – Multiplayer web app framework with game-style synchronization
#36Looks great, congrats on launching. Is this in a similar vein to https://partykit.io/ ?
PartyKit is extremely unopinionated. It's essentially lightweight javascript server, that launches fast and autoscales (I don't say this as as a bad thing, it's a useful primitive). Most people seem to run yjs in PartyKit, but you can also run automerge or even Replicache – my company's other project.
Reflect is entirely focused on providing the best possible multiplayer experience. We make a lot of choices up and down the stack to tightly integrate everything so that multiplayer just works and you can focus on building your app.
That's the plan anyway :).
Re: Reflect – Multiplayer web app framework with game-style synchronization
#37Re: Reflect – Multiplayer web app framework with game-style synchronization
#38Hey hacker news! I'm one of the people behind this, happy to answer any questions.
Re: Reflect – Multiplayer web app framework with game-style synchronization
#39Hey hacker news! I'm one of the people behind this, happy to answer any questions.
1. You wrote "For example, schema validation and migrations just sort of fall out of the design for free." - very curious to read about what you've found to work well for migrations! I feel like there's a lot of nice stuff you can build here (tracking schema version as part of the doc, pushing migration functions into clients, and then clients can live-update) but I never got the chance to build that.
2. Do you have a recommendation for use-cases that involve substantial shared text editing in a TCR system? I'd usually default to Yjs and Tiptap/Prosemirror here (and am watching Automerge Prosemirror with interest). The best idea I've come up with is running two data stores in parallel: a CRDT doc that is a flat key/value identifying a set of text docs keyed by UUID, and a TCR doc representing the data, which occasionally mentions CRDT text UUIDs.
Re: Reflect – Multiplayer web app framework with game-style synchronization
#40Any idea how this compares to Supabase's Realtime & Presence libraries? https://supabase.com/docs/guides/realtime
- Supabase Broadcast: one client sends every other client a one-time message
- Supabase Presence: one client tells all other clients that its own state has changed. This is similar to above, except that server keeps track of all the last-state for each client so that new members of the channel can get up to date.
- Supabase Realtime: server tells all clients when server state changes (so you will not get optimistic client-side changes this way)