SlideShare ist ein Scribd-Unternehmen logo
1 von 85
Overview
MĂĽrten Gustafson
   Stockholm Riak Meetup #1
          2011-03-31
What is Riak
         and what’s the agenda?



Decentralized key-value store
A database ideally suited for web applications
A flexible map/reduce engine
What is Riak
         and what’s the agenda?



Decentralized key-value store
A database ideally suited for web applications
A flexible map/reduce engine
http://www.flickr.com/photos/linneberg/4481309196/
Operations
              HTTP Client
                                              PUT    /bucket/key
                                              GET    /bucket/key
                                              DELETE /bucket/key




                        Item   Item
Item
               Item                    Item
       Item           Item      Item

  Bucket          Bucket          Bucket

         Riak Key/Value Store
An entry

• lives in a bucket
• has a key
• has a value
An entry
                 arbitrary name


• lives in a bucket
             bucket
• has a key
• has a value
An entry
                 arbitrary name


• lives in a bucket
             bucket
• has a key arbitrary name
         key
• has a value
An entry
                 arbitrary name
                                  forms the path
• lives in a bucket
             bucket                 to the value
• has a key arbitrary name
         key
• has a value
An entry
                  arbitrary name
                                   forms the path
• lives in a bucket
             bucket                  to the value
• has a key arbitrary name
         key
• has a value
         value
              a binary blob
             and mime type
An entry
                  arbitrary name
                                        forms the path
• lives in a bucket
             bucket                       to the value
• has a key arbitrary name
         key
• has a value
         value
              a binary blob
             and mime type
                              = Store anything, yay!
Store anything
   bucket meetup
Store anything
                       bucket meetup

key foo.html mime text/html
         <html><body>
              <h1>
   <a href=”bar.html”>foo</a>
             </h1>
        </body></html>
Store anything
                       bucket meetup

key foo.html mime text/html       key bar.html
         <html><body>             mime text/html
              <h1>
   <a href=”bar.html”>foo</a>       <html><body>
             </h1>                 <h1>bar!</h1>
        </body></html>             </body></html>
Store anything
                       bucket meetup

key foo.html mime text/html              key bar.html
         <html><body>                    mime text/html
              <h1>
   <a href=”bar.html”>foo</a>               <html><body>
             </h1>                         <h1>bar!</h1>
        </body></html>                     </body></html>




             http://127.0.0.1:8088/riak/meetup/foo.html
What is Riak
         and what’s the agenda?



Decentralized key-value store
A database ideally suited for web applications
A flexible map/reduce engine
What is Riak
         and what’s the agenda?



Decentralized key-value store
A database ideally suited for web applications
A flexible map/reduce engine
Storage

Riak Key/Value Store
Storage

                 Riak Key/Value Store
Bitcask InnoDB DETS File system   Balanced trees   LRU ETS
Storage

                 Riak Key/Value Store
Bitcask InnoDB DETS File system   Balanced trees   LRU ETS


             disk based,              ram based,
               durable                not durable
Storage

default
                           Riak Key/Value Store
          Bitcask InnoDB DETS File system   Balanced trees   LRU ETS


           commo       disk based,              ram based,
                         durable                not durable
What is Riak
         and what’s the agenda?



Decentralized key-value store
A database ideally suited for web applications
A flexible map/reduce engine
What is Riak
         and what’s the agenda?



Decentralized key-value store
A database ideally suited for web applications
A flexible map/reduce engine
The Ring
The Ring
The Ring
            12     1
     11                    2

10                             3

9                              4

     8                     5
             7     6

          ring size = 12
Consistent Hashing
            12   1
       11            2

  10                     3

   9                     4

       8             5
            7    6
Consistent Hashing
            12   1
       11            2

  10                     3

   9                     4

       8             5
            7    6
Read




“I want “
requires us to know:
where is on the ring?
Read




“I want “
requires us to know:
where is on the ring?
Cluster


One Ring size to rule them all, One Ring size to
nd them, One Ring size to bring them all and in
the cluster bind them...
Cluster

                                            node A


                                            node B


                                            node C


ring size = 12
instances = 3
ring size / nodes = ~slices per instances
Cluster

                                            node A


                                            node B


                                            node C


ring size = 12
instances = 3
ring size / nodes = ~slices per instances
Cluster - Read
node A   node B   node C
Cluster - Read
I can haz     ?



                        node A   node B   node C


Hm,       hashes to a
slice of the ring
owned by node C.
Cluster - Read
I can haz   ?



                     node A   node B   node C

                                                Okidoki, now
     Hey C! I need                              where’s he...a yeah
                                                in my fourth slice
Cluster - Read
I can haz   ?



                node A   node B   node C
So what about...
...network partitions?
  node A   node B   node C
...network partitions?
  node A   node B   X   node C
...failed nodes?
node A   node B   node C
...failed nodes?
node A   node B
...concurrent writes?
 node A     node B   node C




 client 1            client 2
...concurrent writes?
 node A
                       ?
                      node B   node C




                 hey, A!
            save     for me
 client 1                      client 2

                                              hey, C!
                                          save     for me
What is Riak
         and what’s the agenda?



Decentralized key-value store
A database ideally suited for web applications
A flexible map/reduce engine
Livin’ on the web

• concurrent users
• unreliable networks
• node failures
The N to the R to the W to the DW and the RW
N_VAL
Client




          Bucket


Node A    Node B   Node C
N_VAL 1
Client




          Bucket


Node A    Node B   Node C
N_VAL 2
Client




          Bucket


Node A    Node B   Node C
N_VAL 3
Client




          Bucket


Node A    Node B   Node C
R
Client   GET /bucket/key?R=1




          Bucket


Node A    Node B   Node C
R
Client   GET /bucket/key?R=1




          Bucket


Node A    Node B   Node C
R
Client   GET /bucket/key?R=2




          Bucket


Node A    Node B   Node C
R
Client   GET /bucket/key?R=2




          Bucket


Node A    Node B   Node C
R
Client   GET /bucket/key?R=2


         Agree?



           Bucket


Node A    Node B    Node C
R
Client   GET /bucket/key?R=2




          Bucket


Node A    Node B   Node C
The N to the R to the W to the DW and the RW
The N to the R to the W to the DW and the RW

Number of copies
ie. distribute to N nodes
Read
      ie. have R nodes agree


           The N to the R to the W to the DW and the RW

Number of copies
ie. distribute to N nodes
Read
      ie. have R nodes agree


           The N to the R to the W to the DW and the RW
                               Write
Number of copies               ie. ack’d by
ie. distribute to N nodes      W nodes
Durable write
      Read                                    ie. persistently written by
      ie. have R nodes agree                  DW nodes



           The N to the R to the W to the DW and the RW
                               Write
Number of copies               ie. ack’d by
ie. distribute to N nodes      W nodes
Durable write
      Read                                    ie. persistently written by
      ie. have R nodes agree                  DW nodes



           The N to the R to the W to the DW and the RW
                               Write                          Read-write
Number of copies               ie. ack’d by
                                                     ie. persistently deleted by
ie. distribute to N nodes      W nodes
                                                                      RW nodes
The Quorum
([node count] / 2) + 1
Bucket properties


http://127.0.0.1:8088/riak/meetup/
Conflicts
When worlds collide
I don’t care!


 allow_mult = false
last_write_wins = true
I do care!


allow_mult = true
I do care!

•   Resolve conflicts in application logic
•   Conflicts exposed as siblings beneath a key
•   Response is HTTP 300 Multiple Choice
•   Served as mime/multipart
Example
HTTP/1.1 300 Multiple Choices

X-Riak-Vclock: a85hYGBgzWDKBVIsrLnh3BlMiYx5rAymfeeO8EGFWRLl30G==

Content-Type: multipart/mixed; boundary=ZZ3eyjUllBi7GXRRMJsUublFxjn

Content-Length: 368

--ZZ3eyjUllBi7GXRRMJsUublFxjn

Content-Type: text/plain


Tuesday

--ZZ3eyjUllBi7GXRRMJsUublFxjn

Content-Type: text/plain


Thursday

--ZZ3eyjUllBi7GXRRMJsUublFxjn--
What is Riak
         and what’s the agenda?



Decentralized key-value store
A database ideally suited for web applications
A flexible map/reduce engine
Map / Reduce


• Javascript or Erlang
• Exposed in the HTTP API
Map / Reduce      count words




     function(v) {
    var words = v.values[0].data.toLowerCase().match('w*','g');
    var counts = [];
    for(var word in words)
      if (words[word] != '') {
        var count = {};
        count[words[word]] = 1;
        counts.push(count);
      }
    return counts;
}
Map / Reduce      count words




function(values) {
  var result = {};
  for (var value in values) {
    for(var word in values[value]) {
      if (word in result)
        result[word] += values[value][word];
      else
        result[word] = values[value][word];
    }
  }
  return [result];
}
Map & Reduce          count words




 Put this in your POST request and let Riak smoke it

{"inputs":"bucket", "query":[{"map":{"language":"javascript",
"source":"function(v) { var words = v.values[0].data.toLowerCase().match(/
w*/g); var counts = []; for(var word in words) if (words[word] != '')
{ var count = {}; count[words[word]] = 1; counts.push(count); } return
counts; }"}},{"reduce":{"language":"javascript", "source":"function(values)
{ var result = {}; for (var value in values) { for(var word in
values[value]) { if (word in result) result[word] += values[value][word];
else result[word] = values[value][word]; } } return [result]; }"}}]}
Map & Reduce          count words
function(v) {
  var words = v.values[0].data.toLowerCase().match('w*','g');
  var counts = [];
  for(var word in words)
    if (words[word] != '') {
      var count = {};
      count[words[word]] = 1;
      counts.push(count);
    }
  return counts;
}


{"inputs":"bucket", "query":[{"map":{"language":"javascript",
"source":"function(v) { var words = v.values[0].data.toLowerCase().match(/
w*/g); var counts = []; for(var word in words) if (words[word] != '')
{ var count = {}; count[words[word]] = 1; counts.push(count); } return
counts; }"}},{"reduce":{"language":"javascript", "source":"function(values)
{ var result = {}; for (var value in values) { for(var word in
values[value]) { if (word in result) result[word] += values[value][word];
else result[word] = values[value][word]; } } return [result]; }"}}]}
Map & Reduce          count words
function(values) {
  var result = {};
  for (var value in values) {
    for(var word in values[value]) {
      if (word in result)
        result[word] += values[value][word];
      else
        result[word] = values[value][word];
    }
  }
  return [result];
}

{"inputs":"bucket", "query":[{"map":{"language":"javascript",
"source":"function(v) { var words = v.values[0].data.toLowerCase().match(/
w*/g); var counts = []; for(var word in words) if (words[word] != '')
{ var count = {}; count[words[word]] = 1; counts.push(count); } return
counts; }"}},{"reduce":{"language":"javascript", "source":"function(values)
{ var result = {}; for (var value in values) { for(var word in
values[value]) { if (word in result) result[word] += values[value][word];
else result[word] = values[value][word]; } } return [result]; }"}}]}
Map / Reduce


  Demo
Links


• Non-enforced
• Traversable
Links


Demo
The whole enchilada
     HTTP API             Riak Search                                 Luwak
                     Riak Key/Value Store
  Bitcask   InnoDB     DETS         File system       Balanced trees          LRU ETS

                                 Riak Core
             Membership management                Work distribution
                       leave/join


              Cluster state                       Partitioning
               gossip protocol         (consistent hashing, hinted handoff)


                             Erlang / OTP
Try it

          downloads.basho.com


            brew install riak


Web admin @ github.com/gmaurice/Riaktive
Resources

Riak Fast Track @ wiki.basho.com


       #riak @ freenode


       github.com/basho/
Thanks for listening

MĂĽrten Gustafson
@martengustafson

http://marten.gustafson.pp.se/

marten.gustafson@gmail.com

Weitere ähnliche Inhalte

Was ist angesagt?

Thousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/OThousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/OGeorge Cao
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Hiroshi SHIBATA
 
Developing polyglot persistence applications (devnexus 2013)
Developing polyglot persistence applications (devnexus 2013)Developing polyglot persistence applications (devnexus 2013)
Developing polyglot persistence applications (devnexus 2013)Chris Richardson
 
Storing VMs with Cinder and Ceph RBD.pdf
Storing VMs with Cinder and Ceph RBD.pdfStoring VMs with Cinder and Ceph RBD.pdf
Storing VMs with Cinder and Ceph RBD.pdfOpenStack Foundation
 
What you need to know about ceph
What you need to know about cephWhat you need to know about ceph
What you need to know about cephEmma Haruka Iwao
 
QCT Ceph Solution - Design Consideration and Reference Architecture
QCT Ceph Solution - Design Consideration and Reference ArchitectureQCT Ceph Solution - Design Consideration and Reference Architecture
QCT Ceph Solution - Design Consideration and Reference ArchitecturePatrick McGarry
 
Embrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with RippleEmbrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with RippleSean Cribbs
 
Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)Chris Richardson
 
Developing polyglot applications on Cloud Foundry (#oredev 2012)
Developing polyglot applications on Cloud Foundry (#oredev 2012)Developing polyglot applications on Cloud Foundry (#oredev 2012)
Developing polyglot applications on Cloud Foundry (#oredev 2012)Chris Richardson
 
Openstack with ceph
Openstack with cephOpenstack with ceph
Openstack with cephIan Colle
 
drupal 7 amfserver presentation: integrating flash and drupal
drupal 7 amfserver presentation: integrating flash and drupaldrupal 7 amfserver presentation: integrating flash and drupal
drupal 7 amfserver presentation: integrating flash and drupalrolf vreijdenberger
 
The container revolution, and what it means to operators.pptx
The container revolution, and what it means to operators.pptxThe container revolution, and what it means to operators.pptx
The container revolution, and what it means to operators.pptxRobert Starmer
 
Basho and Riak at GOTO Stockholm: "Don't Use My Database."
Basho and Riak at GOTO Stockholm:  "Don't Use My Database."Basho and Riak at GOTO Stockholm:  "Don't Use My Database."
Basho and Riak at GOTO Stockholm: "Don't Use My Database."Basho Technologies
 
Ceph Introduction 2017
Ceph Introduction 2017  Ceph Introduction 2017
Ceph Introduction 2017 Karan Singh
 
Developing polyglot persistence applications #javaone 2012
Developing polyglot persistence applications  #javaone 2012Developing polyglot persistence applications  #javaone 2012
Developing polyglot persistence applications #javaone 2012Chris Richardson
 
XenSummit - 08/28/2012
XenSummit - 08/28/2012XenSummit - 08/28/2012
XenSummit - 08/28/2012Ceph Community
 
New Ceph capabilities and Reference Architectures
New Ceph capabilities and Reference ArchitecturesNew Ceph capabilities and Reference Architectures
New Ceph capabilities and Reference ArchitecturesKamesh Pemmaraju
 
DConf2015 - Using D for Development of Large Scale Primary Storage
DConf2015 - Using D for Development  of Large Scale Primary StorageDConf2015 - Using D for Development  of Large Scale Primary Storage
DConf2015 - Using D for Development of Large Scale Primary StorageLiran Zvibel
 
HKG15-401: Ceph and Software Defined Storage on ARM servers
HKG15-401: Ceph and Software Defined Storage on ARM serversHKG15-401: Ceph and Software Defined Storage on ARM servers
HKG15-401: Ceph and Software Defined Storage on ARM serversLinaro
 

Was ist angesagt? (20)

Thousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/OThousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/O
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0
 
librados
libradoslibrados
librados
 
Developing polyglot persistence applications (devnexus 2013)
Developing polyglot persistence applications (devnexus 2013)Developing polyglot persistence applications (devnexus 2013)
Developing polyglot persistence applications (devnexus 2013)
 
Storing VMs with Cinder and Ceph RBD.pdf
Storing VMs with Cinder and Ceph RBD.pdfStoring VMs with Cinder and Ceph RBD.pdf
Storing VMs with Cinder and Ceph RBD.pdf
 
What you need to know about ceph
What you need to know about cephWhat you need to know about ceph
What you need to know about ceph
 
QCT Ceph Solution - Design Consideration and Reference Architecture
QCT Ceph Solution - Design Consideration and Reference ArchitectureQCT Ceph Solution - Design Consideration and Reference Architecture
QCT Ceph Solution - Design Consideration and Reference Architecture
 
Embrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with RippleEmbrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with Ripple
 
Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)
 
Developing polyglot applications on Cloud Foundry (#oredev 2012)
Developing polyglot applications on Cloud Foundry (#oredev 2012)Developing polyglot applications on Cloud Foundry (#oredev 2012)
Developing polyglot applications on Cloud Foundry (#oredev 2012)
 
Openstack with ceph
Openstack with cephOpenstack with ceph
Openstack with ceph
 
drupal 7 amfserver presentation: integrating flash and drupal
drupal 7 amfserver presentation: integrating flash and drupaldrupal 7 amfserver presentation: integrating flash and drupal
drupal 7 amfserver presentation: integrating flash and drupal
 
The container revolution, and what it means to operators.pptx
The container revolution, and what it means to operators.pptxThe container revolution, and what it means to operators.pptx
The container revolution, and what it means to operators.pptx
 
Basho and Riak at GOTO Stockholm: "Don't Use My Database."
Basho and Riak at GOTO Stockholm:  "Don't Use My Database."Basho and Riak at GOTO Stockholm:  "Don't Use My Database."
Basho and Riak at GOTO Stockholm: "Don't Use My Database."
 
Ceph Introduction 2017
Ceph Introduction 2017  Ceph Introduction 2017
Ceph Introduction 2017
 
Developing polyglot persistence applications #javaone 2012
Developing polyglot persistence applications  #javaone 2012Developing polyglot persistence applications  #javaone 2012
Developing polyglot persistence applications #javaone 2012
 
XenSummit - 08/28/2012
XenSummit - 08/28/2012XenSummit - 08/28/2012
XenSummit - 08/28/2012
 
New Ceph capabilities and Reference Architectures
New Ceph capabilities and Reference ArchitecturesNew Ceph capabilities and Reference Architectures
New Ceph capabilities and Reference Architectures
 
DConf2015 - Using D for Development of Large Scale Primary Storage
DConf2015 - Using D for Development  of Large Scale Primary StorageDConf2015 - Using D for Development  of Large Scale Primary Storage
DConf2015 - Using D for Development of Large Scale Primary Storage
 
HKG15-401: Ceph and Software Defined Storage on ARM servers
HKG15-401: Ceph and Software Defined Storage on ARM serversHKG15-401: Ceph and Software Defined Storage on ARM servers
HKG15-401: Ceph and Software Defined Storage on ARM servers
 

Ähnlich wie 2011 03-31 Riak Stockholm Meetup

Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)Sean Cribbs
 
Introduction data structure for GraphDB
Introduction data structure for GraphDBIntroduction data structure for GraphDB
Introduction data structure for GraphDBshunya kimura
 
Introducing Riak
Introducing RiakIntroducing Riak
Introducing RiakKevin Smith
 
Introducing Riak
Introducing RiakIntroducing Riak
Introducing RiakKevin Smith
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataRoger Xia
 
Introduction to Riak - Red Dirt Ruby Conf Training
Introduction to Riak - Red Dirt Ruby Conf TrainingIntroduction to Riak - Red Dirt Ruby Conf Training
Introduction to Riak - Red Dirt Ruby Conf TrainingSean Cribbs
 
Redis overview for Software Architecture Forum
Redis overview for Software Architecture ForumRedis overview for Software Architecture Forum
Redis overview for Software Architecture ForumChristopher Spring
 
Advanced querying
Advanced queryingAdvanced querying
Advanced queryingstrmpnk
 
Git Going With DVCS v1.5.1
Git Going With DVCS v1.5.1Git Going With DVCS v1.5.1
Git Going With DVCS v1.5.1Matthew McCullough
 
Let's Get to the Rapids
Let's Get to the RapidsLet's Get to the Rapids
Let's Get to the RapidsMaurice Naftalin
 
Accelerating NoSQL
Accelerating NoSQLAccelerating NoSQL
Accelerating NoSQLsunnygleason
 
Hibari presentation at NOSQL AFTERNOON in JAPAN on Nov 1,2010
Hibari presentation at NOSQL AFTERNOON in JAPAN on Nov 1,2010Hibari presentation at NOSQL AFTERNOON in JAPAN on Nov 1,2010
Hibari presentation at NOSQL AFTERNOON in JAPAN on Nov 1,2010CLOUDIAN KK
 
Scaling HDFS to Manage Billions of Files
Scaling HDFS to Manage Billions of FilesScaling HDFS to Manage Billions of Files
Scaling HDFS to Manage Billions of FilesHaohui Mai
 
Scaling HDFS to Manage Billions of Files with Key-Value Stores
Scaling HDFS to Manage Billions of Files with Key-Value StoresScaling HDFS to Manage Billions of Files with Key-Value Stores
Scaling HDFS to Manage Billions of Files with Key-Value StoresDataWorks Summit
 
HIbari/NOSQL/Erlang for Big Data at Erlang User Conference 2010
HIbari/NOSQL/Erlang for Big Data at Erlang User Conference 2010HIbari/NOSQL/Erlang for Big Data at Erlang User Conference 2010
HIbari/NOSQL/Erlang for Big Data at Erlang User Conference 2010CLOUDIAN KK
 
NoSQL learnings from the world of Telco
NoSQL learnings from the world of TelcoNoSQL learnings from the world of Telco
NoSQL learnings from the world of TelcoMahesh Paolini-Subramanya
 
Seminar_Final
Seminar_FinalSeminar_Final
Seminar_FinalCheng Zhang
 
Learning Cassandra
Learning CassandraLearning Cassandra
Learning CassandraDave Gardner
 
Client storage
Client storageClient storage
Client storageParashuram N
 

Ähnlich wie 2011 03-31 Riak Stockholm Meetup (20)

Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)
 
Introduction data structure for GraphDB
Introduction data structure for GraphDBIntroduction data structure for GraphDB
Introduction data structure for GraphDB
 
Introducing Riak
Introducing RiakIntroducing Riak
Introducing Riak
 
Introducing Riak
Introducing RiakIntroducing Riak
Introducing Riak
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_data
 
Introduction to Riak - Red Dirt Ruby Conf Training
Introduction to Riak - Red Dirt Ruby Conf TrainingIntroduction to Riak - Red Dirt Ruby Conf Training
Introduction to Riak - Red Dirt Ruby Conf Training
 
Redis overview for Software Architecture Forum
Redis overview for Software Architecture ForumRedis overview for Software Architecture Forum
Redis overview for Software Architecture Forum
 
Advanced querying
Advanced queryingAdvanced querying
Advanced querying
 
Forget The ORM!
Forget The ORM!Forget The ORM!
Forget The ORM!
 
Git Going With DVCS v1.5.1
Git Going With DVCS v1.5.1Git Going With DVCS v1.5.1
Git Going With DVCS v1.5.1
 
Let's Get to the Rapids
Let's Get to the RapidsLet's Get to the Rapids
Let's Get to the Rapids
 
Accelerating NoSQL
Accelerating NoSQLAccelerating NoSQL
Accelerating NoSQL
 
Hibari presentation at NOSQL AFTERNOON in JAPAN on Nov 1,2010
Hibari presentation at NOSQL AFTERNOON in JAPAN on Nov 1,2010Hibari presentation at NOSQL AFTERNOON in JAPAN on Nov 1,2010
Hibari presentation at NOSQL AFTERNOON in JAPAN on Nov 1,2010
 
Scaling HDFS to Manage Billions of Files
Scaling HDFS to Manage Billions of FilesScaling HDFS to Manage Billions of Files
Scaling HDFS to Manage Billions of Files
 
Scaling HDFS to Manage Billions of Files with Key-Value Stores
Scaling HDFS to Manage Billions of Files with Key-Value StoresScaling HDFS to Manage Billions of Files with Key-Value Stores
Scaling HDFS to Manage Billions of Files with Key-Value Stores
 
HIbari/NOSQL/Erlang for Big Data at Erlang User Conference 2010
HIbari/NOSQL/Erlang for Big Data at Erlang User Conference 2010HIbari/NOSQL/Erlang for Big Data at Erlang User Conference 2010
HIbari/NOSQL/Erlang for Big Data at Erlang User Conference 2010
 
NoSQL learnings from the world of Telco
NoSQL learnings from the world of TelcoNoSQL learnings from the world of Telco
NoSQL learnings from the world of Telco
 
Seminar_Final
Seminar_FinalSeminar_Final
Seminar_Final
 
Learning Cassandra
Learning CassandraLearning Cassandra
Learning Cassandra
 
Client storage
Client storageClient storage
Client storage
 

Mehr von MĂĽrten Gustafson

2011 05-12 nosql-fritidsresor
2011 05-12 nosql-fritidsresor2011 05-12 nosql-fritidsresor
2011 05-12 nosql-fritidsresorMĂĽrten Gustafson
 
2011-06-01-stockholm-devops-blitz
2011-06-01-stockholm-devops-blitz2011-06-01-stockholm-devops-blitz
2011-06-01-stockholm-devops-blitzMĂĽrten Gustafson
 
2011 05-23 metrics-agilasverige-english
2011 05-23 metrics-agilasverige-english2011 05-23 metrics-agilasverige-english
2011 05-23 metrics-agilasverige-englishMĂĽrten Gustafson
 
2010-11-12 Databases overview
2010-11-12 Databases overview2010-11-12 Databases overview
2010-11-12 Databases overviewMĂĽrten Gustafson
 
WebSphere Message Broker In Shared Runtime Environments
WebSphere Message Broker In Shared Runtime EnvironmentsWebSphere Message Broker In Shared Runtime Environments
WebSphere Message Broker In Shared Runtime EnvironmentsMĂĽrten Gustafson
 
WebSphere Message Broker v6.x Overview - 2008-01-09
WebSphere Message Broker v6.x Overview - 2008-01-09WebSphere Message Broker v6.x Overview - 2008-01-09
WebSphere Message Broker v6.x Overview - 2008-01-09MĂĽrten Gustafson
 

Mehr von MĂĽrten Gustafson (6)

2011 05-12 nosql-fritidsresor
2011 05-12 nosql-fritidsresor2011 05-12 nosql-fritidsresor
2011 05-12 nosql-fritidsresor
 
2011-06-01-stockholm-devops-blitz
2011-06-01-stockholm-devops-blitz2011-06-01-stockholm-devops-blitz
2011-06-01-stockholm-devops-blitz
 
2011 05-23 metrics-agilasverige-english
2011 05-23 metrics-agilasverige-english2011 05-23 metrics-agilasverige-english
2011 05-23 metrics-agilasverige-english
 
2010-11-12 Databases overview
2010-11-12 Databases overview2010-11-12 Databases overview
2010-11-12 Databases overview
 
WebSphere Message Broker In Shared Runtime Environments
WebSphere Message Broker In Shared Runtime EnvironmentsWebSphere Message Broker In Shared Runtime Environments
WebSphere Message Broker In Shared Runtime Environments
 
WebSphere Message Broker v6.x Overview - 2008-01-09
WebSphere Message Broker v6.x Overview - 2008-01-09WebSphere Message Broker v6.x Overview - 2008-01-09
WebSphere Message Broker v6.x Overview - 2008-01-09
 

KĂźrzlich hochgeladen

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
UEFA Euro 2024 Clash and Eurovision 2024 Poll Insights.docx
UEFA Euro 2024 Clash and Eurovision 2024 Poll Insights.docxUEFA Euro 2024 Clash and Eurovision 2024 Poll Insights.docx
UEFA Euro 2024 Clash and Eurovision 2024 Poll Insights.docxEuro Cup 2024 Tickets
 
Churu Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
Churu Escorts 🥰 8617370543 Call Girls Offer VIP Hot GirlsChuru Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
Churu Escorts 🥰 8617370543 Call Girls Offer VIP Hot GirlsDeepika Singh
 
Spain to be banned from participating in Euro 2024.docx
Spain to be banned from participating in Euro 2024.docxSpain to be banned from participating in Euro 2024.docx
Spain to be banned from participating in Euro 2024.docxEuro Cup 2024 Tickets
 
Cricket Api Solution.pdfCricket Api Solution.pdf
Cricket Api Solution.pdfCricket Api Solution.pdfCricket Api Solution.pdfCricket Api Solution.pdf
Cricket Api Solution.pdfCricket Api Solution.pdfLatiyalinfotech
 
Trusted Cricket Betting ID Provider In India: Get your Cricket ID Now
Trusted Cricket Betting ID Provider In India: Get your Cricket ID NowTrusted Cricket Betting ID Provider In India: Get your Cricket ID Now
Trusted Cricket Betting ID Provider In India: Get your Cricket ID Nowbacklinks165
 
Italy Vs Albania Italy vs Albania Euro 2024 Prediction Can Albania pull off a...
Italy Vs Albania Italy vs Albania Euro 2024 Prediction Can Albania pull off a...Italy Vs Albania Italy vs Albania Euro 2024 Prediction Can Albania pull off a...
Italy Vs Albania Italy vs Albania Euro 2024 Prediction Can Albania pull off a...World Wide Tickets And Hospitality
 
basketball evolution History Slides.pdf
basketball evolution  History Slides.pdfbasketball evolution  History Slides.pdf
basketball evolution History Slides.pdftishvidphotography
 
Albania Vs Spain South American coaches lead Albania to Euro 2024 spot.docx
Albania Vs Spain South American coaches lead Albania to Euro 2024 spot.docxAlbania Vs Spain South American coaches lead Albania to Euro 2024 spot.docx
Albania Vs Spain South American coaches lead Albania to Euro 2024 spot.docxWorld Wide Tickets And Hospitality
 
Hire 💕 8617370543 Amethi Call Girls Service Call Girls Agency
Hire 💕 8617370543 Amethi Call Girls Service Call Girls AgencyHire 💕 8617370543 Amethi Call Girls Service Call Girls Agency
Hire 💕 8617370543 Amethi Call Girls Service Call Girls AgencyNitya salvi
 
Luka Modric Elevating Croatia's Stars for Euro Cup 2024.docx
Luka Modric Elevating Croatia's Stars for Euro Cup 2024.docxLuka Modric Elevating Croatia's Stars for Euro Cup 2024.docx
Luka Modric Elevating Croatia's Stars for Euro Cup 2024.docxEuro Cup 2024 Tickets
 
JORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdf
JORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdfJORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdf
JORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdfArturo Pacheco Alvarez
 
Unveiling the Mystery of Main Bazar Chart
Unveiling the Mystery of Main Bazar ChartUnveiling the Mystery of Main Bazar Chart
Unveiling the Mystery of Main Bazar ChartChart Kalyan
 
Croatia vs Italy Inter Milan Looking to Carry On Success at Euro 2024.pdf
Croatia vs Italy Inter Milan Looking to Carry On Success at Euro 2024.pdfCroatia vs Italy Inter Milan Looking to Carry On Success at Euro 2024.pdf
Croatia vs Italy Inter Milan Looking to Carry On Success at Euro 2024.pdfEticketing.co
 
Belgium Vs Slovakia Belgium at Euro 2024 Teams in group, fixtures, schedule, ...
Belgium Vs Slovakia Belgium at Euro 2024 Teams in group, fixtures, schedule, ...Belgium Vs Slovakia Belgium at Euro 2024 Teams in group, fixtures, schedule, ...
Belgium Vs Slovakia Belgium at Euro 2024 Teams in group, fixtures, schedule, ...World Wide Tickets And Hospitality
 
Slovenia Vs Serbia Eurovision odds Slovenia have top.docx
Slovenia Vs Serbia Eurovision odds Slovenia have top.docxSlovenia Vs Serbia Eurovision odds Slovenia have top.docx
Slovenia Vs Serbia Eurovision odds Slovenia have top.docxWorld Wide Tickets And Hospitality
 
Genuine 8617370543 Hot and Beautiful 💕 Etah Escorts call Girls
Genuine 8617370543 Hot and Beautiful 💕 Etah Escorts call GirlsGenuine 8617370543 Hot and Beautiful 💕 Etah Escorts call Girls
Genuine 8617370543 Hot and Beautiful 💕 Etah Escorts call GirlsNitya salvi
 
Personal Brand Exploration - By Bradley Dennis
Personal Brand Exploration - By Bradley DennisPersonal Brand Exploration - By Bradley Dennis
Personal Brand Exploration - By Bradley Dennisjocksofalltradespodc
 
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docx
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docxNetherlands Players expected to miss UEFA Euro 2024 due to injury.docx
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docxEuro Cup 2024 Tickets
 

KĂźrzlich hochgeladen (19)

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
UEFA Euro 2024 Clash and Eurovision 2024 Poll Insights.docx
UEFA Euro 2024 Clash and Eurovision 2024 Poll Insights.docxUEFA Euro 2024 Clash and Eurovision 2024 Poll Insights.docx
UEFA Euro 2024 Clash and Eurovision 2024 Poll Insights.docx
 
Churu Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
Churu Escorts 🥰 8617370543 Call Girls Offer VIP Hot GirlsChuru Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
Churu Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
 
Spain to be banned from participating in Euro 2024.docx
Spain to be banned from participating in Euro 2024.docxSpain to be banned from participating in Euro 2024.docx
Spain to be banned from participating in Euro 2024.docx
 
Cricket Api Solution.pdfCricket Api Solution.pdf
Cricket Api Solution.pdfCricket Api Solution.pdfCricket Api Solution.pdfCricket Api Solution.pdf
Cricket Api Solution.pdfCricket Api Solution.pdf
 
Trusted Cricket Betting ID Provider In India: Get your Cricket ID Now
Trusted Cricket Betting ID Provider In India: Get your Cricket ID NowTrusted Cricket Betting ID Provider In India: Get your Cricket ID Now
Trusted Cricket Betting ID Provider In India: Get your Cricket ID Now
 
Italy Vs Albania Italy vs Albania Euro 2024 Prediction Can Albania pull off a...
Italy Vs Albania Italy vs Albania Euro 2024 Prediction Can Albania pull off a...Italy Vs Albania Italy vs Albania Euro 2024 Prediction Can Albania pull off a...
Italy Vs Albania Italy vs Albania Euro 2024 Prediction Can Albania pull off a...
 
basketball evolution History Slides.pdf
basketball evolution  History Slides.pdfbasketball evolution  History Slides.pdf
basketball evolution History Slides.pdf
 
Albania Vs Spain South American coaches lead Albania to Euro 2024 spot.docx
Albania Vs Spain South American coaches lead Albania to Euro 2024 spot.docxAlbania Vs Spain South American coaches lead Albania to Euro 2024 spot.docx
Albania Vs Spain South American coaches lead Albania to Euro 2024 spot.docx
 
Hire 💕 8617370543 Amethi Call Girls Service Call Girls Agency
Hire 💕 8617370543 Amethi Call Girls Service Call Girls AgencyHire 💕 8617370543 Amethi Call Girls Service Call Girls Agency
Hire 💕 8617370543 Amethi Call Girls Service Call Girls Agency
 
Luka Modric Elevating Croatia's Stars for Euro Cup 2024.docx
Luka Modric Elevating Croatia's Stars for Euro Cup 2024.docxLuka Modric Elevating Croatia's Stars for Euro Cup 2024.docx
Luka Modric Elevating Croatia's Stars for Euro Cup 2024.docx
 
JORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdf
JORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdfJORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdf
JORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdf
 
Unveiling the Mystery of Main Bazar Chart
Unveiling the Mystery of Main Bazar ChartUnveiling the Mystery of Main Bazar Chart
Unveiling the Mystery of Main Bazar Chart
 
Croatia vs Italy Inter Milan Looking to Carry On Success at Euro 2024.pdf
Croatia vs Italy Inter Milan Looking to Carry On Success at Euro 2024.pdfCroatia vs Italy Inter Milan Looking to Carry On Success at Euro 2024.pdf
Croatia vs Italy Inter Milan Looking to Carry On Success at Euro 2024.pdf
 
Belgium Vs Slovakia Belgium at Euro 2024 Teams in group, fixtures, schedule, ...
Belgium Vs Slovakia Belgium at Euro 2024 Teams in group, fixtures, schedule, ...Belgium Vs Slovakia Belgium at Euro 2024 Teams in group, fixtures, schedule, ...
Belgium Vs Slovakia Belgium at Euro 2024 Teams in group, fixtures, schedule, ...
 
Slovenia Vs Serbia Eurovision odds Slovenia have top.docx
Slovenia Vs Serbia Eurovision odds Slovenia have top.docxSlovenia Vs Serbia Eurovision odds Slovenia have top.docx
Slovenia Vs Serbia Eurovision odds Slovenia have top.docx
 
Genuine 8617370543 Hot and Beautiful 💕 Etah Escorts call Girls
Genuine 8617370543 Hot and Beautiful 💕 Etah Escorts call GirlsGenuine 8617370543 Hot and Beautiful 💕 Etah Escorts call Girls
Genuine 8617370543 Hot and Beautiful 💕 Etah Escorts call Girls
 
Personal Brand Exploration - By Bradley Dennis
Personal Brand Exploration - By Bradley DennisPersonal Brand Exploration - By Bradley Dennis
Personal Brand Exploration - By Bradley Dennis
 
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docx
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docxNetherlands Players expected to miss UEFA Euro 2024 due to injury.docx
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docx
 

2011 03-31 Riak Stockholm Meetup

  • 1. Overview MĂĽrten Gustafson Stockholm Riak Meetup #1 2011-03-31
  • 2. What is Riak and what’s the agenda? Decentralized key-value store A database ideally suited for web applications A flexible map/reduce engine
  • 3. What is Riak and what’s the agenda? Decentralized key-value store A database ideally suited for web applications A flexible map/reduce engine
  • 5. Operations HTTP Client PUT /bucket/key GET /bucket/key DELETE /bucket/key Item Item Item Item Item Item Item Item Bucket Bucket Bucket Riak Key/Value Store
  • 6. An entry • lives in a bucket • has a key • has a value
  • 7. An entry arbitrary name • lives in a bucket bucket • has a key • has a value
  • 8. An entry arbitrary name • lives in a bucket bucket • has a key arbitrary name key • has a value
  • 9. An entry arbitrary name forms the path • lives in a bucket bucket to the value • has a key arbitrary name key • has a value
  • 10. An entry arbitrary name forms the path • lives in a bucket bucket to the value • has a key arbitrary name key • has a value value a binary blob and mime type
  • 11. An entry arbitrary name forms the path • lives in a bucket bucket to the value • has a key arbitrary name key • has a value value a binary blob and mime type = Store anything, yay!
  • 12. Store anything bucket meetup
  • 13. Store anything bucket meetup key foo.html mime text/html <html><body> <h1> <a href=”bar.html”>foo</a> </h1> </body></html>
  • 14. Store anything bucket meetup key foo.html mime text/html key bar.html <html><body> mime text/html <h1> <a href=”bar.html”>foo</a> <html><body> </h1> <h1>bar!</h1> </body></html> </body></html>
  • 15. Store anything bucket meetup key foo.html mime text/html key bar.html <html><body> mime text/html <h1> <a href=”bar.html”>foo</a> <html><body> </h1> <h1>bar!</h1> </body></html> </body></html> http://127.0.0.1:8088/riak/meetup/foo.html
  • 16. What is Riak and what’s the agenda? Decentralized key-value store A database ideally suited for web applications A flexible map/reduce engine
  • 17. What is Riak and what’s the agenda? Decentralized key-value store A database ideally suited for web applications A flexible map/reduce engine
  • 19. Storage Riak Key/Value Store Bitcask InnoDB DETS File system Balanced trees LRU ETS
  • 20. Storage Riak Key/Value Store Bitcask InnoDB DETS File system Balanced trees LRU ETS disk based, ram based, durable not durable
  • 21. Storage default Riak Key/Value Store Bitcask InnoDB DETS File system Balanced trees LRU ETS commo disk based, ram based, durable not durable
  • 22. What is Riak and what’s the agenda? Decentralized key-value store A database ideally suited for web applications A flexible map/reduce engine
  • 23. What is Riak and what’s the agenda? Decentralized key-value store A database ideally suited for web applications A flexible map/reduce engine
  • 26. The Ring 12 1 11 2 10 3 9 4 8 5 7 6 ring size = 12
  • 27. Consistent Hashing 12 1 11 2 10 3 9 4 8 5 7 6
  • 28. Consistent Hashing 12 1 11 2 10 3 9 4 8 5 7 6
  • 29. Read “I want “ requires us to know: where is on the ring?
  • 30. Read “I want “ requires us to know: where is on the ring?
  • 31. Cluster One Ring size to rule them all, One Ring size to nd them, One Ring size to bring them all and in the cluster bind them...
  • 32. Cluster node A node B node C ring size = 12 instances = 3 ring size / nodes = ~slices per instances
  • 33. Cluster node A node B node C ring size = 12 instances = 3 ring size / nodes = ~slices per instances
  • 34. Cluster - Read node A node B node C
  • 35. Cluster - Read I can haz ? node A node B node C Hm, hashes to a slice of the ring owned by node C.
  • 36. Cluster - Read I can haz ? node A node B node C Okidoki, now Hey C! I need where’s he...a yeah in my fourth slice
  • 37. Cluster - Read I can haz ? node A node B node C
  • 39. ...network partitions? node A node B node C
  • 40. ...network partitions? node A node B X node C
  • 41. ...failed nodes? node A node B node C
  • 43. ...concurrent writes? node A node B node C client 1 client 2
  • 44. ...concurrent writes? node A ? node B node C hey, A! save for me client 1 client 2 hey, C! save for me
  • 45. What is Riak and what’s the agenda? Decentralized key-value store A database ideally suited for web applications A flexible map/reduce engine
  • 46. Livin’ on the web • concurrent users • unreliable networks • node failures
  • 47. The N to the R to the W to the DW and the RW
  • 48. N_VAL Client Bucket Node A Node B Node C
  • 49. N_VAL 1 Client Bucket Node A Node B Node C
  • 50. N_VAL 2 Client Bucket Node A Node B Node C
  • 51. N_VAL 3 Client Bucket Node A Node B Node C
  • 52. R Client GET /bucket/key?R=1 Bucket Node A Node B Node C
  • 53. R Client GET /bucket/key?R=1 Bucket Node A Node B Node C
  • 54. R Client GET /bucket/key?R=2 Bucket Node A Node B Node C
  • 55. R Client GET /bucket/key?R=2 Bucket Node A Node B Node C
  • 56. R Client GET /bucket/key?R=2 Agree? Bucket Node A Node B Node C
  • 57. R Client GET /bucket/key?R=2 Bucket Node A Node B Node C
  • 58. The N to the R to the W to the DW and the RW
  • 59. The N to the R to the W to the DW and the RW Number of copies ie. distribute to N nodes
  • 60. Read ie. have R nodes agree The N to the R to the W to the DW and the RW Number of copies ie. distribute to N nodes
  • 61. Read ie. have R nodes agree The N to the R to the W to the DW and the RW Write Number of copies ie. ack’d by ie. distribute to N nodes W nodes
  • 62. Durable write Read ie. persistently written by ie. have R nodes agree DW nodes The N to the R to the W to the DW and the RW Write Number of copies ie. ack’d by ie. distribute to N nodes W nodes
  • 63. Durable write Read ie. persistently written by ie. have R nodes agree DW nodes The N to the R to the W to the DW and the RW Write Read-write Number of copies ie. ack’d by ie. persistently deleted by ie. distribute to N nodes W nodes RW nodes
  • 68. I don’t care! allow_mult = false last_write_wins = true
  • 70. I do care! • Resolve conflicts in application logic • Conflicts exposed as siblings beneath a key • Response is HTTP 300 Multiple Choice • Served as mime/multipart
  • 71. Example HTTP/1.1 300 Multiple Choices X-Riak-Vclock: a85hYGBgzWDKBVIsrLnh3BlMiYx5rAymfeeO8EGFWRLl30G== Content-Type: multipart/mixed; boundary=ZZ3eyjUllBi7GXRRMJsUublFxjn Content-Length: 368 --ZZ3eyjUllBi7GXRRMJsUublFxjn Content-Type: text/plain Tuesday --ZZ3eyjUllBi7GXRRMJsUublFxjn Content-Type: text/plain Thursday --ZZ3eyjUllBi7GXRRMJsUublFxjn--
  • 72. What is Riak and what’s the agenda? Decentralized key-value store A database ideally suited for web applications A flexible map/reduce engine
  • 73. Map / Reduce • Javascript or Erlang • Exposed in the HTTP API
  • 74. Map / Reduce count words function(v) { var words = v.values[0].data.toLowerCase().match('w*','g'); var counts = []; for(var word in words) if (words[word] != '') { var count = {}; count[words[word]] = 1; counts.push(count); } return counts; }
  • 75. Map / Reduce count words function(values) { var result = {}; for (var value in values) { for(var word in values[value]) { if (word in result) result[word] += values[value][word]; else result[word] = values[value][word]; } } return [result]; }
  • 76. Map & Reduce count words Put this in your POST request and let Riak smoke it {"inputs":"bucket", "query":[{"map":{"language":"javascript", "source":"function(v) { var words = v.values[0].data.toLowerCase().match(/ w*/g); var counts = []; for(var word in words) if (words[word] != '') { var count = {}; count[words[word]] = 1; counts.push(count); } return counts; }"}},{"reduce":{"language":"javascript", "source":"function(values) { var result = {}; for (var value in values) { for(var word in values[value]) { if (word in result) result[word] += values[value][word]; else result[word] = values[value][word]; } } return [result]; }"}}]}
  • 77. Map & Reduce count words function(v) { var words = v.values[0].data.toLowerCase().match('w*','g'); var counts = []; for(var word in words) if (words[word] != '') { var count = {}; count[words[word]] = 1; counts.push(count); } return counts; } {"inputs":"bucket", "query":[{"map":{"language":"javascript", "source":"function(v) { var words = v.values[0].data.toLowerCase().match(/ w*/g); var counts = []; for(var word in words) if (words[word] != '') { var count = {}; count[words[word]] = 1; counts.push(count); } return counts; }"}},{"reduce":{"language":"javascript", "source":"function(values) { var result = {}; for (var value in values) { for(var word in values[value]) { if (word in result) result[word] += values[value][word]; else result[word] = values[value][word]; } } return [result]; }"}}]}
  • 78. Map & Reduce count words function(values) { var result = {}; for (var value in values) { for(var word in values[value]) { if (word in result) result[word] += values[value][word]; else result[word] = values[value][word]; } } return [result]; } {"inputs":"bucket", "query":[{"map":{"language":"javascript", "source":"function(v) { var words = v.values[0].data.toLowerCase().match(/ w*/g); var counts = []; for(var word in words) if (words[word] != '') { var count = {}; count[words[word]] = 1; counts.push(count); } return counts; }"}},{"reduce":{"language":"javascript", "source":"function(values) { var result = {}; for (var value in values) { for(var word in values[value]) { if (word in result) result[word] += values[value][word]; else result[word] = values[value][word]; } } return [result]; }"}}]}
  • 79. Map / Reduce Demo
  • 82. The whole enchilada HTTP API Riak Search Luwak Riak Key/Value Store Bitcask InnoDB DETS File system Balanced trees LRU ETS Riak Core Membership management Work distribution leave/join Cluster state Partitioning gossip protocol (consistent hashing, hinted handoff) Erlang / OTP
  • 83. Try it downloads.basho.com brew install riak Web admin @ github.com/gmaurice/Riaktive
  • 84. Resources Riak Fast Track @ wiki.basho.com #riak @ freenode github.com/basho/
  • 85. Thanks for listening MĂĽrten Gustafson @martengustafson http://marten.gustafson.pp.se/ marten.gustafson@gmail.com