Replies: 4 comments 1 reply
|
Thanks for the comments. I tried to document all of the crdt* packages with inline docs. Those are shown when using the API in any modern IDE, but also get auto-generated by pub.dev, e.g.: https://pub.dev/documentation/crdt or https://pub.dev/documentation/sqlite_crdt As for usage I'm afraid there's only the package examples and tudo, but if you have specific questions I'm happy to answer them as well. |
|
Aha, that's great, I didn't realise that docs were published on pub.dev. Thanks for that link, that's super helpful. I guess I can also find docs for most other Dart packages on there! 🧡 I just watched the CRDTs for Mortals talk. I think you're using a different approach in sql_crdt if I am not mistaken. I'll try to outline how I understand your code works, and perhaps you can correct me if I've misunderstood some parts.
Did I get the gist of that more or less correct? I'm coming at this from the talk Turning the database inside out, which I think is where I'm getting confused. I think your implementation doesn't actually store a list of events. It merely stores the latest version of the state, alongside an HLC value. One concrete question which I haven't been able to figure out yet:
What is the final output? Does the row contain both I don't have Dart / Flutter installed and running (yet), so I can't run the examples to see what actually gets stored in the database. I would assume that if there is only a single |
Perfectly.
Correct, my Depending on the use case your implementation could store the list of events itself and use the crdt as a source of truth for the current state.
The result would be a bunch of errors since your insert is missing the id :-) But seriously, if I understand your intent correctly, the result would be that either At some point I experimented with an implementation which worked on a field level, meaning each field had its own HLC and thus your example would merge correctly. However there are a number of fundamental problems with that strategy:
If your implementation foresees that |
|
Let me know if you decide to use it for your projects, I'm always curious about how others are applying it. |
Uh oh!
There was an error while loading. Please reload this page.
Firstly, thanks for all your work on crdt, it's associated packages, and tudo. It's a rich tapestry of code to learn from as somebody exploring Flutter and Dart.
Is the API for crdt or any of the sub packages (hive_crdt, sqlite_crdt) documented somewhere?
I'm new to the whole Dart ecosystem so maybe I'm missing something obvious. I'm familiar with CRDTs but I'm struggling to see how all the pieces you've built fit together. I've checked out the examples that I can find, and spent some time looking into the tudo code. But I'm still not quite able to see the bigger picture.
All reactions