Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Riak Lunch'n'learn June 2013

Riak Lunch'n'learn June 2013

A short talk about Riak, Basho & Dynamo, Presented at a Techcube Lunch'n'learn.

Sam Elliott

June 25, 2013
Tweet

More Decks by Sam Elliott

Other Decks in Technology

Transcript

  1. Riak What is Riak? Riak is an open source distributed,

    key-value database. Riak is architected for Availability, Fault-Tolerance, Operational Simplicity, and Scalability.
  2. Basho & Riak • Basho originally wrote Riak • Riak

    is now Open-Source • Developers employed by Basho • Basho sell Enterprise Features & Support
  3. Dynamo Dynamo: Amazon’s Highly Available Key-value Store This paper presents

    the design and implementation of Dynamo, a highly available key-value storage system that some of Amazons core services use to provide an always-on experience.
  4. CAP Theorem • Consistency • Availability • Partition-tolerance Eventual Consistency

    A value will eventually see all its updates, once all partition repairs are complete.
  5. Extras Not only a Key-Value store. We also have: •

    MapReduce (Erlang & JS) • Links & Link-walking • Secondary Indexes • Fulltext Search (& More Soon) • CRDTs
  6. Extras Not only a Key-Value store. We also have: •

    MapReduce (Erlang & JS) • Links & Link-walking • Secondary Indexes • Fulltext Search (& More Soon) • CRDTs
  7. Riak Search - Mk II (Coming Soon) Yokozuna Integrate Solr

    itself with a Riak Cluster: use Riak for distribution and Solr for searching. https://github.com/basho/yokozuna
  8. An Approach One Approach to Eventual Consistency: • Use allow_mult=true

    (not the default) • Teach your application how to resolve conflicts • Fetch all siblings • Replace siblings with merged value
  9. Another Approach • Each “actor” maintains their own per-actor data

    • Upon fetch, merged into a single object In General: • Store the data by “actor” • Teach your application how to resolve that structure into an object
  10. Another Approach • Each “actor” maintains their own per-actor data

    • Upon fetch, merged into a single object In General: • Store the data by “actor” • Teach your application how to resolve that structure into an object • CRDTs: Convergent Replicated Data Types
  11. CRDTs Convergent Replicated Data Types Data Structures that Riak knows

    how to merge, preserving all operations. • Counters (PN-Counter, ...) • Sets (OR-Set, ...) • Graphs • TreeDoc (Collaborative Doc) • Maps (field name → CRDT)