trinity icon indicating copy to clipboard operation
trinity copied to clipboard

request for clarification

Open nha opened this issue 8 years ago • 2 comments

Hello, I just discovered trinity and atomix. Looks great! I love the Jepsen tests, and the Clojure lib. This is more of a request for clarification, not an actual "issue".

I have questions about:

  • persistence facilities. Is this a purely in-memory store? If not, how can I configure the file/folder where this is persisted? Can I backup it?

  • Can I extend it with my own primitives? Ie. if I wanted to implement a durable (stored to disk) immutable (like Clojure/Datomic without the datalog part) data structure, where would I start? Can I build on/extend atomix (then I would probably try) or would I have to drop to the Raft implementation (then I would probably not try)?

  • Can I start a server from Clojure as well and maybe avoid the cost of serialization/deserialization etc. ? It would make it easier to start playing, and also simplify deployments in my case.

nha avatar Oct 07 '17 12:10 nha

Hi @nha -

So Trinity is pretty barebones - we basically created it just to make Jepsen testing a bit easier. That said, that Atomix APIs are pretty straightforward, as you can see from Trinity, so using them from Clojure isn't that difficult. As for your questions:

  • Atomix can store on disk (durable), in memory, or memory mapped. You specify the type of storage you want via a Storage object which is then supplied to your replica.
  • You certainly can create your own primitives. That's the primary selling point of Atomix - being able to create your own state machines, essentially, that will automatically handle and replicate operations in a strongly consistent way. Here are some docs on that. You might also be interested in this blog post which describes how to build a custom datastore using the Copycat APIs, which Atomix is based on and more or less similar.
  • Sure you can run Atomix from Clojure. Re: serialization, Atomix still needs to replicate your operations across servers, which it does by serializing them. There's no way to avoid that.

jhalterman avatar Oct 07 '17 15:10 jhalterman

It seems like there have been significant api changes. I seem to be able to make a storage object, but cannot find the Replica anymore.

nha avatar Oct 11 '17 08:10 nha