SlideShare une entreprise Scribd logo
1  sur  54
Télécharger pour lire hors ligne
Jon Meredith   Basho Technologies



Tuesday, December 7, 2010
WHAT IS IT?




Tuesday, December 7, 2010
Riak is
                            a scalable, highly-available, networked
                                        key/value store.



 basho
Tuesday, December 7, 2010
Inspired by Amazon’s Dynamo
                              ...with some enhancements.

                                   Open Source


 basho
Tuesday, December 7, 2010
Riak is
                            a scalable, highly-available, networked
                                     key/value store.



Tuesday, December 7, 2010
• Stores   and retrieves data against a key.

                            • Encode    your data how you like it.

                            • Keys   are organized into buckets.




 basho
Tuesday, December 7, 2010
BASIC OPERATIONS

                                  get
                                  put
                                 delete


 basho
Tuesday, December 7, 2010
• Riak   also stores metadata against keys

                             • Content Type, Charset, Encoding, ...

                             • Custom     application metadata




 basho
Tuesday, December 7, 2010
Riak is
                            a scalable, highly-available, networked
                                          key/value store.


 basho
Tuesday, December 7, 2010
bucket: pivotal
                            key: greeting
                            value: “<h1>Hi Pivotal<h1>”
                            metadata:
                              content-type=text/html
                              charset=utf8




 basho
Tuesday, December 7, 2010
>     PUT /riak/pivotal/greeting HTTP/1.1
               >     User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
               >     Host: 127.0.0.1:8098
               >     Accept: */*
               >     content-type: text/html
               >     charset: utf8
               >     Content-Length: 19
               >
               >     <h1>Hi Pivotal<h1>

               < HTTP/1.1 200 OK
               < X-Riak-Vclock: a85hYGBgzWDKBVIsTNPiOTOYEhnzWBm+5uUf5YMIszUnMdcLv4dKsOTDJVhYPx1JwiLMeH/
               bU6iwWj6yMUwtt6yQJbIA
               < Vary: Accept-Encoding
               < Server: MochiWeb/1.1 WebMachine/1.6 (eat around the stinger)
               < Link: </riak/pivotal>; rel="up"
               < Date: Mon, 24 May 2010 21:44:06 GMT
               < Content-Type: text/html
               < Content-Length: 19
               <




 basho
Tuesday, December 7, 2010
> GET /riak/pivotal/greeting HTTP/1.1
               > User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
               > Host: localhost:8098
               > Accept: */*
               >
               < HTTP/1.1 200 OK
               < X-Riak-Vclock: a85hYGBgymDKBVIsrDk3LTOYEhnzWBmUmtOP8kGE2ZqTmNf8Xg6VCAJJZAEA
               < Vary: Accept-Encoding
               < Server: MochiWeb/1.1 WebMachine/1.6 (eat around the stinger)
               < Link: </riak/pivotal>; rel="up"
               < Last-Modified: Tue, 18 May 2010 21:32:02 GMT
               < ETag: 1VW7QmCuyofVCuQbqBNVYh
               < Date: Tue, 18 May 2010 21:32:06 GMT
               < Content-Type: text/html; charset=utf8
               < Content-Length: 19
               <
               * Connection #0 to host localhost left intact
               * Closing connection #0
               <h1>Hi Pivotal</h1>




 basho
Tuesday, December 7, 2010
OTHER INTERFACES TOO!


        • Protocol            Buffers Client

              • Messages         encoded using Protocol Buffers

              • 3-10x        speedups depending on data

        • Native            Erlang client



 basho
Tuesday, December 7, 2010
Riak is
                            a scalable, highly-available, networked
                                      key/value store.



Tuesday, December 7, 2010
Riak was designed to scale horizontally.




 basho
Tuesday, December 7, 2010
Tuesday, December 7, 2010
Tuesday, December 7, 2010
Tuesday, December 7, 2010
Tuesday, December 7, 2010
Tuesday, December 7, 2010
Riak is
                        a scalable, highly-available, networked
                                       key/value store.



Tuesday, December 7, 2010
Tuesday, December 7, 2010
Tuesday, December 7, 2010
Tuesday, December 7, 2010
#Replicas - N            R+W > N
   #Get response - R
   #Put responses - W       for quorum




Tuesday, December 7, 2010
Tuesday, December 7, 2010
Tuesday, December 7, 2010
Tuesday, December 7, 2010
Tuesday, December 7, 2010
Tuesday, December 7, 2010
WILL THE REAL OBJECT PLEASE STEP
                                       FORWARD?

        • Riak              always accepts writes - even during network partitions and other badness

        • Objects              are versioned to automatically detect ancestors/siblings

        • Conflicts              are detected on reads

        • Eventually             consistent



 basho
Tuesday, December 7, 2010
That sounds great...
                            but can I do anything without a key?



Tuesday, December 7, 2010
Query datasets with
                              Map / Reduce


 basho
Tuesday, December 7, 2010
basho
Tuesday, December 7, 2010
function(v) {
                               var m = v.values[0].data.
                                       match('w*','g');
                               var r = [];
                               for(var i in m)
                                  if (m[i] != '') {
                                     var o = {};
                                     o[m[i]] = 1;
                                     r.push(o);
                                  }
                               return r;
                            }




 basho
Tuesday, December 7, 2010
map()
                                    function(v) {
                                       var m = v.values[0].data.
                                               match('w*','g');
                                       var r = [];
                                       for(var i in m)
                                          if (m[i] != '') {
                                             var o = {};
                                             o[m[i]] = 1;
                                             r.push(o);
                                          }
                                       return r;
                                    }




 basho
Tuesday, December 7, 2010
map()

                                    map()           map()




                            map()                           map()




                                    map()           map()

                                            map()
 basho
Tuesday, December 7, 2010
R1

                                 R8        R2




                            R7                  R3




                                 R6        R4

                                      R5
 basho
Tuesday, December 7, 2010
R2
                            reduce()
                                6
                                5
                                8
                                7
                                4
                                3
                                1
                                       function(v) {
                                       	    var r = {};
                                       	    for (var i in v) {
                                       	       for(var w in v[i]) {
                                       	          if (w in r)
                                       	             r[w] += v[i][w];
                                       	          else
                                       	             r[w] = v[i][w];
                                       	       }
                                       	    }
                                       	    return [r];
                                       	 }




 basho
Tuesday, December 7, 2010
Store relationships
                                with links


 basho
Tuesday, December 7, 2010
ch ild
                                                             people/dean
                            child
                                                   chi
                                                      ld
              people/bob            people/alice




                                                             people/claire
 basho
Tuesday, December 7, 2010
he r
                                                    mot
                                                        ch ild
                            father                                    people/dean
                            child                       mo
                                                              the
                                                                  r
                                                    chi
                                                         ld
              people/bob             people/alice




                                                                      people/claire
 basho
Tuesday, December 7, 2010
he r
                                                hild     m ot
                                         grandc
                                                             ch ild
                             father                             so  n     people/dean
                              child                          mo
                                                                  the
                            daughter                                  r
                                                          chi
                                                       dau ld
              people/bob                  people/alice    ght
                                       grandc                er
                                              hild



                                                                          people/claire
 basho
Tuesday, December 7, 2010
he r
                                                     m ot
                                                         ch ild
                             father                         so  n     people/dean
                              child                      mo
                                                              the
                            daughter                              r
                                                      chi
                                                   dau ld
           people/bob                 people/alice    ght
                                                         er
          GET /riak/person/bob/people,child,_
                           key link link
                               bucket tag
                                                                      people/claire
 basho
Tuesday, December 7, 2010
he r
                                                       mot
                                                           ch ild
                             father                           so  n     people/dean
                              child                        mo
                                                                the
                            daughter                                r
                                                        chi
                                                     dau ld
          people/bob                 people/alice       ght
                                                           er
         GET /riak/person/bob/people,child,_/_,child,_
                          key link1 link1 link2 link2
                               bucket tag bucket tag
                                                                        people/claire
 basho
Tuesday, December 7, 2010
he r
                                                       mot
                                                           ch ild
                             father                           so  n     people/dean
                              child                        mo
                                                                the
                            daughter                                r
                                                        chi
                                                    dau ld
          people/bob                 people/alice       ght
                                                           er
         GET /riak/person/bob/people,child,1/people,child,_

                                                                        people/claire
 basho
Tuesday, December 7, 2010
COMPARED TO RDBMS

        • No                schema                              • No schema migrations - version your
                                                                 objects
        • No                transactions
                                                                • Noreplication topologies - just add
        • No                joins (but we do have map/reduce)    nodes to scale
        • No      secondary indices (but we do have
             links!)




Tuesday, December 7, 2010
CLIENT LIBRARIES


                                                 Ruby


                                               Javascript
                            Java

                              .NET linq   Twisted Python

 basho
Tuesday, December 7, 2010
RIAK IN PRODUCTION



 basho
Tuesday, December 7, 2010
MOCHI MEDIA
                                                    www.mochimedia.com

        • Multiple             clusters in production

        • Sessions             (web and Flash) - 5 nodes, ~20MM keys - highest traffic
                                                                                                   Developer
        • User              data storage - 3 nodes, bucket-per-game

        • URL               Shortener - 2 nodes, bucket-per-game

        • Social             graph - 3 nodes, OAuth credentials, relationships

                                                                                        Text and link here but
 basho
Tuesday, December 7, 2010
MOZILLA TEST PILOT
                                                        http://bit.ly/aC0i4f



        • Data              collector for anonymized Firefox usage statistics

        • High              peak throughput - pure writes

        • Large             MapReduce queries for analytics             “Riak meets or exceeds all the write
                                                                      performance requirements...it was nice to
                                                                          see predictable performance and
                                                                                stability under load.”

 basho
Tuesday, December 7, 2010
WEGEO

        • Mobile       Productivity / Collaboration App
             - Task lists, Shopping lists, Calendar

        • Event             and Check-in logs

        • Monthly             reports archive                  “Scalability I could understand, on
                                                                a platform I could understand.”
        • Third-party            coupon and deal aggregation


 basho
Tuesday, December 7, 2010
GETTING RIAK
                               Prebuild Packages            The Bleeding Edge




                                                          https://github.com/basho



                                                         http://bitbucket.org/basho
                            http://downloads.basho.com

Tuesday, December 7, 2010
http://wiki.basho.com
                            follow twitter.com/basho/team
                              riak-users@lists.basho.com
                                  #riak on Freenode

 basho
Tuesday, December 7, 2010

Contenu connexe

Similaire à Riak Intro

Opening up the Social Web - Standards that are bridging the Islands
Opening up the Social Web - Standards that are bridging the Islands Opening up the Social Web - Standards that are bridging the Islands
Opening up the Social Web - Standards that are bridging the Islands Bastian Hofmann
 
Introduction to SARA's Hadoop Hackathon - dec 7th 2010
Introduction to SARA's Hadoop Hackathon - dec 7th 2010Introduction to SARA's Hadoop Hackathon - dec 7th 2010
Introduction to SARA's Hadoop Hackathon - dec 7th 2010Evert Lammerts
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Adrian Olaru
 
Ruby on CouchDB - SimplyStored and RockingChair
Ruby on CouchDB - SimplyStored and RockingChairRuby on CouchDB - SimplyStored and RockingChair
Ruby on CouchDB - SimplyStored and RockingChairJonathan Weiss
 
Distributed Social Networking
Distributed Social NetworkingDistributed Social Networking
Distributed Social NetworkingBastian Hofmann
 
Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Matt Aimonetti
 
Web Development With Ruby - From Simple To Complex
Web Development With Ruby - From Simple To ComplexWeb Development With Ruby - From Simple To Complex
Web Development With Ruby - From Simple To ComplexBrian Hogan
 
Scala in hulu's data platform
Scala in hulu's data platformScala in hulu's data platform
Scala in hulu's data platformPrasan Samtani
 
How Steve Jobs Would Disrupt The Truck & Bus Industry
How Steve Jobs Would Disrupt The Truck & Bus IndustryHow Steve Jobs Would Disrupt The Truck & Bus Industry
How Steve Jobs Would Disrupt The Truck & Bus IndustryJohan Ronnestam
 
Will iPython replace Bash?
Will iPython replace Bash?Will iPython replace Bash?
Will iPython replace Bash?Babel
 
Will iPython replace bash?
Will iPython replace bash?Will iPython replace bash?
Will iPython replace bash?Roberto Polli
 
Moving to Dojo 1.7 and the path to 2.0
Moving to Dojo 1.7 and the path to 2.0Moving to Dojo 1.7 and the path to 2.0
Moving to Dojo 1.7 and the path to 2.0James Thomas
 

Similaire à Riak Intro (20)

Meet Couch DB
Meet Couch DBMeet Couch DB
Meet Couch DB
 
Node.js and Ruby
Node.js and RubyNode.js and Ruby
Node.js and Ruby
 
09 Data
09 Data09 Data
09 Data
 
Opening up the Social Web - Standards that are bridging the Islands
Opening up the Social Web - Standards that are bridging the Islands Opening up the Social Web - Standards that are bridging the Islands
Opening up the Social Web - Standards that are bridging the Islands
 
Introduction to SARA's Hadoop Hackathon - dec 7th 2010
Introduction to SARA's Hadoop Hackathon - dec 7th 2010Introduction to SARA's Hadoop Hackathon - dec 7th 2010
Introduction to SARA's Hadoop Hackathon - dec 7th 2010
 
04 Reports
04 Reports04 Reports
04 Reports
 
04 reports
04 reports04 reports
04 reports
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Ruby on CouchDB - SimplyStored and RockingChair
Ruby on CouchDB - SimplyStored and RockingChairRuby on CouchDB - SimplyStored and RockingChair
Ruby on CouchDB - SimplyStored and RockingChair
 
Distributed Social Networking
Distributed Social NetworkingDistributed Social Networking
Distributed Social Networking
 
Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010
 
Node.js - A Quick Tour II
Node.js - A Quick Tour IINode.js - A Quick Tour II
Node.js - A Quick Tour II
 
Web Development With Ruby - From Simple To Complex
Web Development With Ruby - From Simple To ComplexWeb Development With Ruby - From Simple To Complex
Web Development With Ruby - From Simple To Complex
 
Everyday - mongodb
Everyday - mongodbEveryday - mongodb
Everyday - mongodb
 
Scala in hulu's data platform
Scala in hulu's data platformScala in hulu's data platform
Scala in hulu's data platform
 
07 problem-solving
07 problem-solving07 problem-solving
07 problem-solving
 
How Steve Jobs Would Disrupt The Truck & Bus Industry
How Steve Jobs Would Disrupt The Truck & Bus IndustryHow Steve Jobs Would Disrupt The Truck & Bus Industry
How Steve Jobs Would Disrupt The Truck & Bus Industry
 
Will iPython replace Bash?
Will iPython replace Bash?Will iPython replace Bash?
Will iPython replace Bash?
 
Will iPython replace bash?
Will iPython replace bash?Will iPython replace bash?
Will iPython replace bash?
 
Moving to Dojo 1.7 and the path to 2.0
Moving to Dojo 1.7 and the path to 2.0Moving to Dojo 1.7 and the path to 2.0
Moving to Dojo 1.7 and the path to 2.0
 

Dernier

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 

Dernier (20)

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 

Riak Intro

  • 1. Jon Meredith Basho Technologies Tuesday, December 7, 2010
  • 2. WHAT IS IT? Tuesday, December 7, 2010
  • 3. Riak is a scalable, highly-available, networked key/value store. basho Tuesday, December 7, 2010
  • 4. Inspired by Amazon’s Dynamo ...with some enhancements. Open Source basho Tuesday, December 7, 2010
  • 5. Riak is a scalable, highly-available, networked key/value store. Tuesday, December 7, 2010
  • 6. • Stores and retrieves data against a key. • Encode your data how you like it. • Keys are organized into buckets. basho Tuesday, December 7, 2010
  • 7. BASIC OPERATIONS get put delete basho Tuesday, December 7, 2010
  • 8. • Riak also stores metadata against keys • Content Type, Charset, Encoding, ... • Custom application metadata basho Tuesday, December 7, 2010
  • 9. Riak is a scalable, highly-available, networked key/value store. basho Tuesday, December 7, 2010
  • 10. bucket: pivotal key: greeting value: “<h1>Hi Pivotal<h1>” metadata: content-type=text/html charset=utf8 basho Tuesday, December 7, 2010
  • 11. > PUT /riak/pivotal/greeting HTTP/1.1 > User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3 > Host: 127.0.0.1:8098 > Accept: */* > content-type: text/html > charset: utf8 > Content-Length: 19 > > <h1>Hi Pivotal<h1> < HTTP/1.1 200 OK < X-Riak-Vclock: a85hYGBgzWDKBVIsTNPiOTOYEhnzWBm+5uUf5YMIszUnMdcLv4dKsOTDJVhYPx1JwiLMeH/ bU6iwWj6yMUwtt6yQJbIA < Vary: Accept-Encoding < Server: MochiWeb/1.1 WebMachine/1.6 (eat around the stinger) < Link: </riak/pivotal>; rel="up" < Date: Mon, 24 May 2010 21:44:06 GMT < Content-Type: text/html < Content-Length: 19 < basho Tuesday, December 7, 2010
  • 12. > GET /riak/pivotal/greeting HTTP/1.1 > User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3 > Host: localhost:8098 > Accept: */* > < HTTP/1.1 200 OK < X-Riak-Vclock: a85hYGBgymDKBVIsrDk3LTOYEhnzWBmUmtOP8kGE2ZqTmNf8Xg6VCAJJZAEA < Vary: Accept-Encoding < Server: MochiWeb/1.1 WebMachine/1.6 (eat around the stinger) < Link: </riak/pivotal>; rel="up" < Last-Modified: Tue, 18 May 2010 21:32:02 GMT < ETag: 1VW7QmCuyofVCuQbqBNVYh < Date: Tue, 18 May 2010 21:32:06 GMT < Content-Type: text/html; charset=utf8 < Content-Length: 19 < * Connection #0 to host localhost left intact * Closing connection #0 <h1>Hi Pivotal</h1> basho Tuesday, December 7, 2010
  • 13. OTHER INTERFACES TOO! • Protocol Buffers Client • Messages encoded using Protocol Buffers • 3-10x speedups depending on data • Native Erlang client basho Tuesday, December 7, 2010
  • 14. Riak is a scalable, highly-available, networked key/value store. Tuesday, December 7, 2010
  • 15. Riak was designed to scale horizontally. basho Tuesday, December 7, 2010
  • 21. Riak is a scalable, highly-available, networked key/value store. Tuesday, December 7, 2010
  • 25. #Replicas - N R+W > N #Get response - R #Put responses - W for quorum Tuesday, December 7, 2010
  • 31. WILL THE REAL OBJECT PLEASE STEP FORWARD? • Riak always accepts writes - even during network partitions and other badness • Objects are versioned to automatically detect ancestors/siblings • Conflicts are detected on reads • Eventually consistent basho Tuesday, December 7, 2010
  • 32. That sounds great... but can I do anything without a key? Tuesday, December 7, 2010
  • 33. Query datasets with Map / Reduce basho Tuesday, December 7, 2010
  • 35. function(v) { var m = v.values[0].data. match('w*','g'); var r = []; for(var i in m) if (m[i] != '') { var o = {}; o[m[i]] = 1; r.push(o); } return r; } basho Tuesday, December 7, 2010
  • 36. map() function(v) { var m = v.values[0].data. match('w*','g'); var r = []; for(var i in m) if (m[i] != '') { var o = {}; o[m[i]] = 1; r.push(o); } return r; } basho Tuesday, December 7, 2010
  • 37. map() map() map() map() map() map() map() map() basho Tuesday, December 7, 2010
  • 38. R1 R8 R2 R7 R3 R6 R4 R5 basho Tuesday, December 7, 2010
  • 39. R2 reduce() 6 5 8 7 4 3 1 function(v) { var r = {}; for (var i in v) { for(var w in v[i]) { if (w in r) r[w] += v[i][w]; else r[w] = v[i][w]; } } return [r]; } basho Tuesday, December 7, 2010
  • 40. Store relationships with links basho Tuesday, December 7, 2010
  • 41. ch ild people/dean child chi ld people/bob people/alice people/claire basho Tuesday, December 7, 2010
  • 42. he r mot ch ild father people/dean child mo the r chi ld people/bob people/alice people/claire basho Tuesday, December 7, 2010
  • 43. he r hild m ot grandc ch ild father so n people/dean child mo the daughter r chi dau ld people/bob people/alice ght grandc er hild people/claire basho Tuesday, December 7, 2010
  • 44. he r m ot ch ild father so n people/dean child mo the daughter r chi dau ld people/bob people/alice ght er GET /riak/person/bob/people,child,_ key link link bucket tag people/claire basho Tuesday, December 7, 2010
  • 45. he r mot ch ild father so n people/dean child mo the daughter r chi dau ld people/bob people/alice ght er GET /riak/person/bob/people,child,_/_,child,_ key link1 link1 link2 link2 bucket tag bucket tag people/claire basho Tuesday, December 7, 2010
  • 46. he r mot ch ild father so n people/dean child mo the daughter r chi dau ld people/bob people/alice ght er GET /riak/person/bob/people,child,1/people,child,_ people/claire basho Tuesday, December 7, 2010
  • 47. COMPARED TO RDBMS • No schema • No schema migrations - version your objects • No transactions • Noreplication topologies - just add • No joins (but we do have map/reduce) nodes to scale • No secondary indices (but we do have links!) Tuesday, December 7, 2010
  • 48. CLIENT LIBRARIES Ruby Javascript Java .NET linq Twisted Python basho Tuesday, December 7, 2010
  • 49. RIAK IN PRODUCTION basho Tuesday, December 7, 2010
  • 50. MOCHI MEDIA www.mochimedia.com • Multiple clusters in production • Sessions (web and Flash) - 5 nodes, ~20MM keys - highest traffic Developer • User data storage - 3 nodes, bucket-per-game • URL Shortener - 2 nodes, bucket-per-game • Social graph - 3 nodes, OAuth credentials, relationships Text and link here but basho Tuesday, December 7, 2010
  • 51. MOZILLA TEST PILOT http://bit.ly/aC0i4f • Data collector for anonymized Firefox usage statistics • High peak throughput - pure writes • Large MapReduce queries for analytics “Riak meets or exceeds all the write performance requirements...it was nice to see predictable performance and stability under load.” basho Tuesday, December 7, 2010
  • 52. WEGEO • Mobile Productivity / Collaboration App - Task lists, Shopping lists, Calendar • Event and Check-in logs • Monthly reports archive “Scalability I could understand, on a platform I could understand.” • Third-party coupon and deal aggregation basho Tuesday, December 7, 2010
  • 53. GETTING RIAK Prebuild Packages The Bleeding Edge https://github.com/basho http://bitbucket.org/basho http://downloads.basho.com Tuesday, December 7, 2010
  • 54. http://wiki.basho.com follow twitter.com/basho/team riak-users@lists.basho.com #riak on Freenode basho Tuesday, December 7, 2010