Rolling With Riak

  • 7,388 views
Uploaded on

Overview of Riak's NoSQL distributed key/value data store by John Lynch from Rigel Group.

Overview of Riak's NoSQL distributed key/value data store by John Lynch from Rigel Group.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
7,388
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
115
Comments
0
Likes
8

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. (Yet-Another-NoSQL-DB) Presented By John Lynch [email_address]
  • 2. Web App Developers ORM Focus on the App Speed of Development DB Agnostic(ish) Fixed Schema Limits design choices Migration Hell Scaling at DB layer Rails!
  • 3. Shiny New Toys Decades of research and best practices Awesome ad-hoc query capability Zillions of vendors/tools/libraries/code Flexibility of schema-less design Ability to scale…. Web-scale
  • 4. Web Scale
    • Changing App Types
      • Social
      • Games
      • Marketing / Advertising
    • Freemium Business Models
      • 1M free => 10K paying customers
  • 5. NoSQL Landscape
    • Pure Key/Value (Redis/Tokyo Cabinet/etc)
    • Key/Value+ (CouchDB/MongoDB/Riak)
    • BigTable Type (Hbase, HyperTable)
    • Choose wisely! No standard API.
    (Good general overview can be found here: http://cattell.net/datastores/Datastores.pdf)
  • 6. MongoDB
    • Popular with Ruby community
    • Combines Key/Value with ability to do Indexed Queries
  • 7. Scaling MongoDB Master, Slave, Replica Set, Replica Pair, Shard Server, Connection Pool, ack!
  • 8. Scaling MongoDB 
  • 9. If all you want is NoSQL… NoSQL on MySQL Leverages all MySQL skills, tools, techniques, stability, dependability If you want NoSQL + Scalability… … not so much.
  • 10. Riak
    • Developed by Basho.com
    • Used on several large production sites
    • Written in Erlang
    • Distributed – Fault Tolerant
    • Buckets – Keys – Values
    • Values can be anything (json,binary,etc)
    • Ruby & Rails Client (Ripple project @ Github)
  • 11. Riak speaks HTTP > curl –i http://host:8098/riak/bucket1/key1 HTTP/1.1 200 OK X-Riak-Vclock: awpcFAA== Content-Type: text/plain Content-Length: 9 Last-Modified: Wed, 01 Se… Etag: 45364657 I am a value Leverage existing HTTP infrastructure, tools, etc
  • 12. Scaling Riak Riak Riak Riak Riak Riak Http Load Balancer Varnish (cache) Standard HTTP Protocol Rails Rails Rails Rails Rails
  • 13. Scaling Riak (alt) Riak Rails Nginx Riak Rails Nginx Riak Rails Nginx Riak Rails Nginx Riak Rails Nginx Http Load Balancer Varnish (cache) Standard HTTP Protocol
  • 14. Key Differentiator - Distributed
    • Inspired by Amazon’s Dynamo
    • Uses consistent hashing algorithim
    • No “Master Node”
    • No single point of failure
    • Any node can service any request
    • Automatically rebalances as nodes join
    • Tunable CAP Properties
      • Consistency, Availability, Partition Tolerance
  • 15. N R W
    • N = # of copies of the data
    • R = # of nodes necessary to read
    • W = # of nodes necessary to write
    • Tunable by the application, on a per-bucket and per-query basis
  • 16.
    • Low Value Data (N=2 R=1 W=1)
      • Logging
    • Web Content (N=4 R=1 W=4)
      • Maximum availability and consistency
    • Financial Data (N=4 R=1 W=4 DW=4)
      • DW is “Durable Write”
    Riak cluster of 4 Physical Computers
  • 17. Network Split
  • 18. Network Split
  • 19. Network Split
  • 20. Map/Reduce
    • Map steps run on each node
    • Final reduce runs on single node
    results = Riak::MapReduce.new(client). add(“albums”). map("function(v){ return [JSON.parse(v.values[0].data).title]; }", :keep => true).run
  • 21. Links
    • Riak documents can have links to other documents, each link can be “tagged”
    • Link data is separate from doc data
    • Easy URL access to walk these links
      • GET /riak/artists/TheBeatles/albums,_,_/tracks,_,1
  • 22. When NOT to use Riak
    • Single machine
    • Small scale or bog-standard apps
    • Need rich ad-hoc indexed queries
    • Need mature tools and libraries
  • 23. Any questions? (First round at Rock Bottom generously sponsored by Basho.com)