0
Riak and Ruby
                            Grant Schofield
                          Developer Advocate
                    ...
Grant Schofield
                        (@schofield)


                                basho

basho
Friday, July 9, 2010
NoSQL
                       •Web 2.0, Cloud, Enterprise???
                       •Useful Reference Point
               ...
NoSQL Includes...
                       •Key Value Stores
                       •Document Databases
                    ...
Prevalent Now
                       •Memcache???
                       •Session Data
                       •Caching Dat...
Riak
                       •Open Source
                       •Erlang
                       •Dynamo and CAP Theorem Infl...
Dynamo Paper
                       •Key Value Store Built By Amazon for
                         Core Services

         ...
CAP Theorem
                             Consistency, Availability,
                               Partition Tolerance
   ...
Advanced Key
                              Value Store?
                       •Not Just PUT and GET Key/Values
          ...
Web Shaped
                       •Biggest Distributed System Ever
                       •Works Like the Web
            ...
Fundamentally
                             Distributed
                       •Built From The Start
                      ...
Consistent Hashing
                                             node 0
                                             node 1...
N, R, and W
                       •N = Number of Replicas
                       •R = Number of Replicas Needed for a
   ...
R Value
                                   get(<<"beer">>,<<"dnr">>,
                                             R=2)

  ...
W Value
                                   put(<<"beer">>,<<"dnr">>,
                                             W=2)

  ...
N=10, R/W = 2
                                                get/put("beer", "dnr",
                                     ...
Riak from Curl
                          Putting Data In




basho
Friday, July 9, 2010
Taking Data Out




basho
Friday, July 9, 2010
Deleting The Data




basho
Friday, July 9, 2010
Finally, Ruby Stuff

                       •Sean Cribbs - RDRC Training
                       •riak-client - basic clien...
riak-client
                       gem install riak-client




basho
Friday, July 9, 2010
riak-client
                        get the data




basho
Friday, July 9, 2010
riak-client
                         moar datas




basho
Friday, July 9, 2010
riak client
                          got beer




basho
Friday, July 9, 2010
riak-client
                         why yes, I do




basho
Friday, July 9, 2010
Link Walking
              http://localhost:8098/riak/beers/dnr/bars,_,1
          http://localhost:8098/riak/bars/blue_no...
riak-client
                        find me a dnr!




basho
Friday, July 9, 2010
what does the Fry have on tap?




basho
Friday, July 9, 2010
in a bottle?




basho
Friday, July 9, 2010
riak-client
                         ok, via ruby




basho
Friday, July 9, 2010
riak client
                       via ruby with map reduce




basho
Friday, July 9, 2010
riak-client
                           map




basho
Friday, July 9, 2010
riak-client
                        map and reduce




basho
Friday, July 9, 2010
ripple
                       gem install ripple




basho
Friday, July 9, 2010
schema design
                                   riak_20100704

                       people      riak_20100705
         ...
basho
Friday, July 9, 2010
basho
Friday, July 9, 2010
A Model




basho
Friday, July 9, 2010
Other Features

basho
Friday, July 9, 2010
Riak as a Platform


basho
Friday, July 9, 2010
What’s Coming


basho
Friday, July 9, 2010
THANKS!
                       http://wiki.basho.com
                       riak-users@lists.basho.com
                   ...
Upcoming SlideShare
Loading in...5
×

Riak and Ruby

5,521

Published on

Published in: Technology, Education
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,521
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
77
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide

Transcript of "Riak and Ruby"

  1. 1. Riak and Ruby Grant Schofield Developer Advocate Basho Technologies, Inc. basho Friday, July 9, 2010
  2. 2. Grant Schofield (@schofield) basho basho Friday, July 9, 2010
  3. 3. NoSQL •Web 2.0, Cloud, Enterprise??? •Useful Reference Point •Not AntiSQL •Schemaless (Mostly) •Diverse •Thoughtful Data (Not just a NoSQL basho Friday, July 9, 2010
  4. 4. NoSQL Includes... •Key Value Stores •Document Databases •Graphing Databases •Column Databases •Schemaless MySQL basho Friday, July 9, 2010
  5. 5. Prevalent Now •Memcache??? •Session Data •Caching Data •Complements Traditional RDBMS •Not The Magical Unicorn, but Pony Perhaps basho Friday, July 9, 2010
  6. 6. Riak •Open Source •Erlang •Dynamo and CAP Theorem Influenced •Advanced Key Value Store •Web Shaped •Distributed by Nature •Ops Obsessed •A Platform basho Friday, July 9, 2010
  7. 7. Dynamo Paper •Key Value Store Built By Amazon for Core Services •Sacrifice Availability for Consistency •Consistent Hashing •Merkle Trees •Vector Clocks •Eventually Consistent basho Friday, July 9, 2010
  8. 8. CAP Theorem Consistency, Availability, Partition Tolerance •Dr. Eric Brewer •At a Given Point You Get Two of the Three •Riak is Tunable •Eventual Consistency - Not an Excuse to Lose Data basho Friday, July 9, 2010
  9. 9. Advanced Key Value Store? •Not Just PUT and GET Key/Values •Multiple Interfaces •Links •Document Like •Pluggable Backend •Map/Reduce •Distributed basho Friday, July 9, 2010
  10. 10. Web Shaped •Biggest Distributed System Ever •Works Like the Web •Links •Talks HTTP Restfully •Load Balances Just Like Web Stuff basho Friday, July 9, 2010
  11. 11. Fundamentally Distributed •Built From The Start •Masterless •Homogenous •Consistent Hashing •Scales Horizontally •Fault Tolerant (Hinted Handoff) basho Friday, July 9, 2010
  12. 12. Consistent Hashing node 0 node 1 2160/4 node 2 node 3 hash(<<"beer">>,<<"dns">>) 2160/2 basho Friday, July 9, 2010
  13. 13. N, R, and W •N = Number of Replicas •R = Number of Replicas Needed for a Read •W = Number of Replicas Needed for a Write •DW = Number of Replicas Needed for a Durable Write •N Configurable Per Bucket •R and W Configurable Per Request basho Friday, July 9, 2010
  14. 14. R Value get(<<"beer">>,<<"dnr">>, R=2) (N=3) {ok, Object} X basho Friday, July 9, 2010
  15. 15. W Value put(<<"beer">>,<<"dnr">>, W=2) (N=3) ok X basho Friday, July 9, 2010
  16. 16. N=10, R/W = 2 get/put("beer", "dnr", R/W=2) (N=10) {ok, Object} X X X X X X X X basho Friday, July 9, 2010
  17. 17. Riak from Curl Putting Data In basho Friday, July 9, 2010
  18. 18. Taking Data Out basho Friday, July 9, 2010
  19. 19. Deleting The Data basho Friday, July 9, 2010
  20. 20. Finally, Ruby Stuff •Sean Cribbs - RDRC Training •riak-client - basic client •ripple - associations, ActiveModel •Really Elegant Code basho Friday, July 9, 2010
  21. 21. riak-client gem install riak-client basho Friday, July 9, 2010
  22. 22. riak-client get the data basho Friday, July 9, 2010
  23. 23. riak-client moar datas basho Friday, July 9, 2010
  24. 24. riak client got beer basho Friday, July 9, 2010
  25. 25. riak-client why yes, I do basho Friday, July 9, 2010
  26. 26. Link Walking http://localhost:8098/riak/beers/dnr/bars,_,1 http://localhost:8098/riak/bars/blue_note/beers,tap,1 http://localhost:8098/riak/areas/midtown/ /bars,tap,_/beers,_,1 basho Friday, July 9, 2010
  27. 27. riak-client find me a dnr! basho Friday, July 9, 2010
  28. 28. what does the Fry have on tap? basho Friday, July 9, 2010
  29. 29. in a bottle? basho Friday, July 9, 2010
  30. 30. riak-client ok, via ruby basho Friday, July 9, 2010
  31. 31. riak client via ruby with map reduce basho Friday, July 9, 2010
  32. 32. riak-client map basho Friday, July 9, 2010
  33. 33. riak-client map and reduce basho Friday, July 9, 2010
  34. 34. ripple gem install ripple basho Friday, July 9, 2010
  35. 35. schema design riak_20100704 people riak_20100705 tweets nosql_20100705 mongodb_20100705 basho Friday, July 9, 2010
  36. 36. basho Friday, July 9, 2010
  37. 37. basho Friday, July 9, 2010
  38. 38. A Model basho Friday, July 9, 2010
  39. 39. Other Features basho Friday, July 9, 2010
  40. 40. Riak as a Platform basho Friday, July 9, 2010
  41. 41. What’s Coming basho Friday, July 9, 2010
  42. 42. THANKS! http://wiki.basho.com riak-users@lists.basho.com freenode #riak basho Friday, July 9, 2010
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×