@name = name @data = {} @ring = ConsistentHash.new(nodes, partitions) end def put(key, value) if @name == @ring.node(key) puts "put #{key} #{value}" @data[ @ring.hash(key) ] = value end end def get(key) if @name == @ring.node(key) puts "get #{key}" @data[@ring.hash(key)] end end end Tuesday, May 28, 13
vclock:{adam:1}} • Barb wants Tacos {value:"tacos", vclock:{barb:1}} • Adam gets the value, the system can’t resolve, so he gets bolth [{value:"pizza", vclock:{adam:1}}, {value:"tacos", vclock:{barb:1}}] • Adam resolves the value however he wants {value:"taco pizza", vclock:{adam:2, barb:1}} Tuesday, May 28, 13
information in my nodes residing out in cyber space, While other datastorers keep consistent values just in case, It's tolerant partitions and high uptime, that I embrace. Tuesday, May 28, 13
hash ensures k/v's are never ever out of place, I replicate my data across more than one partition, In case a running node or two encounters decommission. Tuesday, May 28, 13
demands you've only 2 to choose from preferentially, In short, you get consistency or high availability, To claim you can distribute and do both is pure futility. Tuesday, May 28, 13
with Entropy, since practically a quorum is consistent only sloppily, My favorite solutions are both read repair and AAE, My active anti-entropy trades deltas via Merkel Tree. Tuesday, May 28, 13
replicated data types are a solution: I only take a change in state, and not results imperforate, And merge results to forge a final value that is proximate. Tuesday, May 28, 13
Well naturally, I use Lamport logic ordered vector-clocks. I have both sibling values when my v-clocks face a conflict, and keep successive values 'til a single one is picked. Tuesday, May 28, 13
Invert-indexing values may reduce query obtuseness. Distributing a graph or a relation-style structure, though somewhat possible provides a weaker juncture. Tuesday, May 28, 13
a toss up, To keep in sync my nodes will chat through protocol gossip. I am a mesh type network, not tree/star topological, their single points of failure make such choices most illogical. Tuesday, May 28, 13
quick, But know that CAP demands my choice give only 2 to pick. In short, I get consistency or high availability, To claim I could distribute and do both is just futility. Tuesday, May 28, 13