Some thoughts...
- What about putting the
typein theContent-Typefield? Something likex-crdt-g-set-v1 - What's the rationale for representing things as a hash with lists as values instead of two hashes (in the OR and LWW set for example)? This to me seems closer to how it'll be represented in code (or at least how I've chosen to do with knockbox).
On JSON vs. Protobuf:
JSON has the advantage of easily being used in the browser, so you could actually use the browser's timestamp for some of the operations. This can be useful if for a single key, the single browser is the main actor doing writes. JSON also works easily with javascript mapreduce. If size is a concern, I'd be curious to see the size difference between compressed (snappy maybe?) JSON and Protobuf. I'm not saying Protobuf is a bad choice, just things to consider.
Yeah this is a good point. +1 for the optional subtype params
Maybe I'm misremembering JSON/Javascript, but I believe hashes can have arbitrary Strings as keys, just like the values in your lists. Looking here briefly seems to support my understanding.
respresentation
I'm not convinced of any real speed differences in representation. One method requires two hash lookups (
O(1)), and the other requires one hash lookup and accessing a vector (in javascript accessing a vector is really a hash with integers as keys, iirc). Maybe I'm totally off base here though?Having both protobuf and JSON is hard to argue with :)