Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thanks - very interesting stuff!

> Yes. Zero uses server reconciliation, like our previous products Replicache and Reflect. You can read more here: https://rocicorp.dev/blog/ready-player-two

Oh I hadn't seen that before, and I love that. It looks like an extension of database transactions / MVCC into the client.

Its interesting thinking about what situations this will & won't work in. I imagine it'd work for most of the mutations made in most applications, like editing rows in a database. And in your example, inserting at the end of a list would work.

But what about inserting in the middle of a list (or, typing in a text document)? Naively, it wouldn't work because "insert at position X" changes its meaning wrt. concurrent edits. But you could make OT work if you provided a way to change the arguments themselves if concurrent changes were detected. (Thats essentially all OT is. When concurrent changes happen, run the transform function. op = transform(op, other_op)).

Interestingly, I think you could use a text CRDT (like yjs) with your architecture. You would need to run the crdt's prepare function in the client first, to convert the edit into the CRDT's format (eg for Yjs, that looks like Insert('a', left_id: XX, right_id: YY). Then if you passed that object into the transaction closure, you could run the CRDT on the server and it'd all work out.

Its not quite as obvious and straightforward as your examples. But still, very cool that its extensible like that.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: