8 ms·
Antidote: CRDT-based distributed database
- kevmo314 9y agoThis has that "too good to be true" vibe, and I can't find much information on the authors or the Syncfree Consortium organization that backs the project besides their own website. Is this at the cost of fast writes or flexible schema? The pitch video doesn't seem to mention any cons, yet seems to avoid mentioning the type of data or mutations supported. I guess I'll go read their publications.
- gjem97 9y agoI think the issue you're looking for is a limited number of supported datatypes. This doesn't appear to be a general-purpose database at the moment: don't expect to drop it in as a replacement for MySQL. Doesn't mean it can't be in the future, but it would have to fall back on other techniques for the datatypes that can't be built with CRDTs. http://syncfree.github.io/antidote/crdts.html http://syncfree.github.io/antidote/crdts.html
- lopatin 9y agoI think the data types look fine. If I'm using such a database, I don't think I want the CRDT data types to be abstracted away behind some general-purpose (SQL?) interface. Can that even be done? I'd rather just pay the small price of restructuring my data into maps and sets and have the CRDT database do the rest without any extra indirection.
- jpdsousa 9y agoWell, i've been working on an SQL interface for AntidoteDB for my master thesis, and yes, it can be done. However, there are some limitations. At this point we are mostly focusing in constraints (i.e. invariant preservation), and we've already figured out stuff like numeric bounds, entity integrity and referential integrity (this last one is quite interesting IMO). Github: https://github.com/JPDSousa/AQL https://github.com/JPDSousa/AQL
- dustingetz 9y agoI don't think it encodes a graph that you query (like, say, Neo4J or Postgres with an orm); it seems to give various replicated data structure primitives, like documents, basically a kv store? So for building something like google docs.
- nine_k 9y agoOne glaring omission is indexes. You can likely build something SQL-like to form complex queries coordinating related objects, but the efficiency of such queries is not a given. You can likely manually build something like an index to speed up lookups using e.g. the map primitive. With a plan for a complex query, you're on your own. Another likely problematic part is PK generation. You can of course use a counter, but I'm not sure how efficient will it be with burst inserts. For that, you'd have to come up with client-generated PKs that are unlikely to clash, e.g. UUIDs.
- anne_biene 9y ago(one of the maintainers of Antidote) There is a lot of research still going on in the back, including indexing, access control, verification tools for apps, and some other really cool stuff. Efficient support for queries is non-trivial, indeed.
- KirinDave 9y agoIt's a government sponsored project so one would expect their publicity to be limited. That's part of the reason I posted it. Stuff like this is extremely exciting. It's at the cost of playing by the rules of CRDTs. Making CRDTs consequence-free is ongoing research.
- teleclimber 9y ago> Making CRDTs consequence-free is ongoing research. What do you mean by that? I found possibly related language on this page the other day [0]: CRDTs are "[t]ypically not suited for editing application with consequent UI." Can you point me in the right direction? My googling got me nowhere. Thanks. [0] https://irisate.com/collaborative-editing-solutions-round-up/ https://irisate.com/collaborative-editing-solutions-round-up...
- KirinDave 9y agoI dunno about that quote, Treedoc works pretty well. In general there are tradeoffs to CRDTs and not everyone loves those tradeoffs. As time goes on we find CRDTs that make better tradeoffs. For example, the earliest examples of CRDT sets grew linearly with the values added to the set, without regard for deletion. For all time. That's a pretty steep cost.
- teleclimber 9y agoI get it, thank-you.
- bpicolo 9y agoLSEQ appears to improve upon treedoc in ways, too: https://hal.archives-ouvertes.fr/hal-00921633/document https://hal.archives-ouvertes.fr/hal-00921633/document
- Horusiath 9y agoIt's not described in the docs, but elswhere [1] in their github repository you can find the note about rga, which is Replicated Growable Array CRDT, that can be used for building indexed linear sequences - shortly speaking arrays of elements with insert/remove semantics. [1](https://github.com/SyncFree/antidote/blob/842874ca5ecffe947e75fa6a67c1ad0d9c6ccb87/docs/pages/mydoc/rawapi.md https://github.com/SyncFree/antidote/blob/842874ca5ecffe947e...)
- marc_shapiro 9y agoA write is fast, because it happens directly at the closest replica, without any inter-replica synchronisation. There is no schema per se; rather the DB is object-oriented, and each application picks the object types it needs from the CRDT library. The library currently covers the basics: registers, flags, sets, maps, lists.
- deleted 9y ago[deleted]
- Cieplak 9y agoLooking forward to Kyle Kingsbury’s Jepsen review.
- elvinyung 9y agoJepsen goes into detail about general CRDTs here: https://aphyr.com/posts/285-jepsen-riak https://aphyr.com/posts/285-jepsen-riak
- lostcolony 9y agoYes, but devil's in the details. The fact CRDTs are provably able to have specific consistency guarantees doesn't mean a particular implementation does it correctly in all contexts. Without testing, "We built this (city) on CRDTs" isn't very useful.
- elvinyung 9y agoSure. My point is that it's a rough idea of what you could expect. If you look at the Jepsen posts for Cassandra and Riak, for example, you can see that the general characteristics are fairly similar.
- KirinDave 9y agoWhat's nice about building databases on compositions of CRDTs is that if you can validate the individual CRDTs via automated testing, you have a very high degree of confidence the composition of those CRDTs will do something similar. No one's arguing that a Jepsen test shouldn't be done. Just that it'll probably be very different in character from more invented industry technology.
- lostcolony 9y agoYes; if you can prove a system was built atop an academically sound paradigm, it's more likely to adhere to the guarantees that paradigm is intended to provide than a system built atop an unproven paradigm. Kinda goes without saying, though. :P Unsnarkily, I agree that implementation and composition of CRDTs is comparatively straightforward compared with other approaches people have taken. But if correct behavior is a requirement, full testing is too, regardless of how easy it -should- be in theory.
- xinsight 9y agoThe video lists pros/cons for strongly consistent and eventually consistent databases, but only has pros for a "just right consistency" database. What are the cons?
- gjem97 9y agoLimited support for datatypes? http://syncfree.github.io/antidote/crdts.html http://syncfree.github.io/antidote/crdts.html
- joaomlneto 9y agoThe idea of the "just right consistency" is that it brings the best of both worlds, without any drawbacks. Your application works as well as if it was executed fully in strong consistency, but with improved scalability for the set of operations that can execute in an eventual consistent model. https://www.youtube.com/watch?v=HJjWqNDh-GA https://www.youtube.com/watch?v=HJjWqNDh-GA
- erik_seaberg 9y agoThe biggest drawback is that only some operations can be supported. E.g., without strong consistency you can detect double-spending from an account but you can't prevent it, because the validity of an operation can't depend on operations a datacenter hasn't seen.
- KirinDave 9y agoFinancial examples are bad because in fact the financial world IS eventually consistent. It's quite possible to withdraw the same $100 from an account via multiple ATM machines.
- nine_k 9y agoWith ATMs and debit cards, I thinks it's generally not true, they seem to use the online mode and update the balance of a checking account within seconds. With credit cards, you can indeed start more transactions against the same balance, and you're never sure in which order they will complete.
- skrebbel 9y agoAt first glance, this looks amazing. I truly believe CRDTs are the solution to lots of distributed systems problems, and that exposing their characteristics to developers directly, rather than trying to abstract them away in nicer, but leaky, abstractions, is the right way to go. That said, a major part of why databases are hard is that reliable storage is hard. I see remarkably little about this on Antidote's homepage. I'd wish this was just a frontend to some battle tested storage engine but it appears that this is not the case.
- nine_k 9y agoIt appears to use Riak as the storage layer.
- cmeiklejohn 9y ago(committer here) It uses Riak Core as the underlying distribution layer, which is the same that Riak itself uses. For storage of the log, the built-in Erlang disk_log is used.
- skrebbel 9y agoAh great! That makes this very cool all of a sudden. How did I miss that?
- cmeiklejohn 9y ago(committer on Antidote, Riak and Lasp) We're investigating a backend that works on LevelDB and RocksDB. We just haven't had the academic resources to get it implemented yet. However, it's largely an engineering resource problem and not a theoretical problem.
- skrebbel 9y ago> However, it's largely an engineering resource problem and not a theoretical problem. I appreciate your openness and honesty here, but the moment that an academic says that all the theory is solved and now "it's largely an engineering resource problem" is when people from industry tend to get nervous :-) The majority of aspects that make databases robust aren't theoretical problems but "mere" engineering problems. Nevertheless there's an enormous variety in quality in this area. Pile sufficiently many engineering problems together and it becomes very hard to get right.
- cmeiklejohn 9y agoMember of the SyncFree Consortium (and committer to Antidote) here. Here's a video from J On The Beach this year on the details around the Just-Right Consistency approach that might help answer some questions: https://www.youtube.com/watch?v=Vd2I9v3pYpA https://www.youtube.com/watch?v=Vd2I9v3pYpA
- cmeiklejohn 9y agoHere's links to other things in the SyncFree group. Lasp (previously on HN): https://news.ycombinator.com/item?id=14300763 https://news.ycombinator.com/item?id=14300763 https://news.ycombinator.com/item?id=15444156 https://news.ycombinator.com/item?id=15444156 SyncFree project review results: http://cordis.europa.eu/result/rcn/197514_en.html http://cordis.europa.eu/result/rcn/197514_en.html Legion: https://syncfree.lip6.fr/index.php/2-uncategorised/54-legion https://syncfree.lip6.fr/index.php/2-uncategorised/54-legion SyncFree homepage: http://syncfree.lip6.fr http://syncfree.lip6.fr
- cmeiklejohn 9y agoFurther follow-up: we're (members of the SyncFree consortium and it's follow up project for moving CRDTs, Antidote, and Lasp to the edge) considering raising money to industrialize Antidote (and it's associated tool chain) for building Just-Right Consistency applications. If you'd be interested in any of the above, or just using the database and/or trying the tools, reach out to me via email christopher.meiklejohn at gmail.com or cmeik on Twitter.
- sturadnidge 9y agoThat video is really good - perfect for the layperson such as myself!
- marc_shapiro 9y agoSee also this video comparing Antidote to other kinds of data stores: https://youtu.be/oWUNCsFy-r0 https://youtu.be/oWUNCsFy-r0
- marknadal 9y agoHey, author of GUN (the current most popular generalizable CRDT based database), and want to say I'm impressed. I'm often the first to nitpick things but this looks great: - Built in Erlang - Great explainer videos - Well documented CRDTs that you accept - Team of university related researches in CRDTs. I'll be looking through your guys stuff more. But good job! We need more people like you guys out there.
- dang 9y agoWe detached this comment from https://news.ycombinator.com/item?id=15863587 https://news.ycombinator.com/item?id=15863587 and marked it off-topic.
- deleted 9y ago[deleted]
- ShabbosGoy 9y agoCan anyone explain the advantages/disadvantages of using CRDTs over OT (operational transformation)?
- marknadal 9y agoOT requires a centralized server for intention resolution. CRDT does not. It can be fully P2P.
- continuational 9y agoHow would I do a "put if absent" in this database? Is it efficient?
- marc_shapiro 9y agoIf the thing you "put" into is a CRDT, then two concurrent "put" will be merged, if that's OK for your application. If however you want to disallow concurrent "put"s then you need to add some concurrency control to the CRDT layer. See the CISE tool https://youtu.be/HJjWqNDh-GA https://youtu.be/HJjWqNDh-GA, http://dx.doi.org/10.1145/2911151.2911160 http://dx.doi.org/10.1145/2911151.2911160. Antidote doesn't yet support concurrency control, it's work in progress.
- fiatjaf 9y agoI wanted a database that would receive "events" asynchronously and stored that, but at the same time would process these events (from some piece of previously written code) to generate a queryable schema. If I wanted to change the schema later, the database would let me just rewrite the code and it would reprocess all the received events since the beggining. My use case is not anything high-performance or with thousands of writes -- it's the opposite.
- davidw 9y agoI wonder what it looks like in terms of resource usage. I think there's a strong case for something like this for IoT type devices. Imagine the simple case of adding a name to a contact list on a mobile device, and wanting that to get synced up with a series of other devices.
- Xeoncross 9y agoIt's written in erlang so should be better ram usage than a Java database.
- cmeiklejohn 9y agoI wouldn't say "better"; I'd probably say that the memory profile would be completely different. It all depends on the number of actors, the size of objects, and the workload. Remember: for large binary objects, references on a shared heap are sent and messages are not explicitly copied per actor. This means it's dependent on the workload and both the structure of how many processes are involved in a single request.
- cmeiklejohn 9y ago(committer on Antidote, author of Lasp, both SyncFree projects) Antidote is designed for DC deployments, in the hundreds of clusters. It provides causal consistency and transactions. Lasp is designed for high-churn, edge deployments (with CRDTs) and provides eventual consistency: it's designed for 1,000+ nodes. They share a bit of code, and you might want to evaluate both to determine which is a better use case: Lasp might be a better fit for the IoT application, because it was designed for that. Here's a HN post on Lasp's scalability: https://news.ycombinator.com/item?id=15444156 https://news.ycombinator.com/item?id=15444156 Here's a HN post on Lasp: https://news.ycombinator.com/item?id=14300763 https://news.ycombinator.com/item?id=14300763
- takeda 9y agoThis is based on riak which is written in erlang. Those nodes connect in a mesh, and actually the limit of scaling is about 100 nodes in one cluster.
- dqv 9y agoDoes anyone have this compiling on Erlang 20?
- anne_biene 9y agoWe tried a couple of weeks back, but then most dependencies have not been upgraded yet. The problem is that, to my knowledge, there is no riak_core for Erlang 20.
- cmeiklejohn 9y agoI suggest that you build on top of the Riak Core from Heinz Gies. That's what we are using in some of our new projects.
- anne_biene 9y agoThis is what we actually do. I checked a couple of weeks ago with Heinz, but there wasn't a version available (but maybe I misunderstood him...). Can you point me to an Erlang 20 compatible version?
- cmeiklejohn 9y agoAh, we might be pulling a branch for our Riak Core work. I can look into it tomorrow and get back to you.
- creed0r 9y agoIt's nice that there's some reasonable research going on and this stuff will probably help build some solid systems... but do you really have to call it "Cure" and "Antidote"? Think of what you are implying with those names... It has this thick smell of academia arrogance all over it which I always find deeply disturbing. I think what these types of projects need the most is humility. Please reconsider how you present yourself and your work...
- shalabhc 9y agoRelated ideas exist in David Reed's 'Atomic Actions' which use pseudotime: http://www.cs.sfu.ca/~vaughan/teaching/431/papers/reed83.pdf http://www.cs.sfu.ca/~vaughan/teaching/431/papers/reed83.pdf: "thinking about objects as sequences of unchangeable versions, object histories" "the correct construction and execution of a new atomic action can be accomplished without knowledge of all other atomic actions in the system that might execute concurrently" Is anyone aware of comparisons between these two streams of ideas (pseudo time based action and CRDT based)?
- jlu 9y agoFYI, that paper was from 1983, CRDT was introduced 2007, conceptually they share the same idea, but most modern CRDT implementations tends to use Lamport timestamp to causally solve conflicts. In short, antidote looks like a decent solution to this kind of problems.
- jnordwick 9y agoFor anybody else wondering what CRDT means: conflict-free replication datatype. https://en.m.wikipedia.org/wiki/Conflict-free_replicated_data_type https://en.m.wikipedia.org/wiki/Conflict-free_replicated_dat...
- avodonosov 9y agoOne more idea about distributed consistencywithout synchronization: http://avodonosov.blogspot.com.by/2016/09/partitioned-available-and-consistent.html http://avodonosov.blogspot.com.by/2016/09/partitioned-availa... Comments?
- chrisweekly 9y agoCRDT: Conflict-Free Replicated Datatype https://en.m.wikipedia.org/wiki/Conflict-free_replicated_data_type https://en.m.wikipedia.org/wiki/Conflict-free_replicated_dat...
- haadcode 9y agoThis absolutely awesome! I'm very excited for AntidoteDB, for its use cases but also for the underlying, pioneering work you're doing on CRDTs. Thank you for doing it! <3
- manigandham 9y agoThere was also Datanet announced last year: http://highscalability.com/blog/2016/10/17/datanet-a-new-crdt-database-that-lets-you-do-bad-bad-things.html http://highscalability.com/blog/2016/10/17/datanet-a-new-crd... It's now rebranded as Kuhiro: http://highscalability.com/blog/2017/11/6/birth-of-the-nearcloud-serverless-crdts-edge-is-the-new-next.html http://highscalability.com/blog/2017/11/6/birth-of-the-nearc...
- dvirsky 9y agoThere's also CRDB, a CRDT based version of Redis (closed source, and disclosure - I work for Redis Labs) https://redislabs.com/redis-enterprise-documentation/administering/database-operations/create-crdb/ https://redislabs.com/redis-enterprise-documentation/adminis...