SlideShare uma empresa Scribd logo
1 de 41
Jon Meredith   Basho Technologies
Riak is
        a scalable, highly-available, networked
                    key/value store.



basho
Inspired by Amazon’s Dynamo
          ...with some enhancements.

               Open Source


basho
• Riak   stores values against keys.

        • Encode    your data how you like it.

        • Keys   are organized into buckets.




basho
BASIC OPERATIONS

              get
              put
             delete


basho
• Riak   also stores metadata against keys

         • Content Type, Charset, Encoding, ...

         • Custom     application metadata




basho
bucket: gluecon
        key: greeting
        value: “<h1>Hi GlueCon<h1>”
        metadata:
          content-type=text/html
          charset=utf8




basho
>   PUT /riak/gluecon/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 GlueCon<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/gluecon>; rel="up"
        < Date: Mon, 24 May 2010 21:44:06 GMT
        < Content-Type: text/html
        < Content-Length: 19
        <




basho
> GET /riak/gluecon/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/gluecon>; 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 GlueCon</h1>




basho
Riak was designed to scale horizontally.




basho
Riak is highly available


basho
#Replicas - N        R+W > N
#Get response - R
#Put responses - W   for quorum
Query your data with map/reduce


basho
basho
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
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
map()

                map()           map()




        map()                           map()




                map()           map()

                        map()
basho
R1

             R8        R2




        R7                  R3




             R6        R4

                  R5
basho
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
Store relationships with links


basho
ch ild
                                                       people/dean
                     child
                                            chi
                                                  ld
        people/bob           people/alice




                                                       people/claire
basho
he r
                                             m ot
                                                ch ild
                     father                                  people/dean
                     child                      mo
                                                     the
                                                         r
                                              chi
                                                  ld
        people/bob            people/alice




                                                             people/claire
basho
he r
                                          hild      m ot
                                  gra ndc
                                                       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
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
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,_/_,child,_
                    key link1 link1 link2 link2
                         bucket tag bucket tag
                                                                  people/claire
basho
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,1/people,child,_

                                                                  people/claire
basho
CLIENT LIBRARIES


                             Ruby


                           Javascript
        Java

          .NET linq   Twisted Python

basho
http://wiki.basho.com
           follow twitter.com/basho/team
             riak-users@lists.basho.com
                 #riak on Freenode

basho

Mais conteúdo relacionado

Último

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Último (20)

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Destaque

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Riak in Ten Minutes

  • 1. Jon Meredith Basho Technologies
  • 2. Riak is a scalable, highly-available, networked key/value store. basho
  • 3. Inspired by Amazon’s Dynamo ...with some enhancements. Open Source basho
  • 4. • Riak stores values against keys. • Encode your data how you like it. • Keys are organized into buckets. basho
  • 5. BASIC OPERATIONS get put delete basho
  • 6. • Riak also stores metadata against keys • Content Type, Charset, Encoding, ... • Custom application metadata basho
  • 7. bucket: gluecon key: greeting value: “<h1>Hi GlueCon<h1>” metadata: content-type=text/html charset=utf8 basho
  • 8. > PUT /riak/gluecon/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 GlueCon<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/gluecon>; rel="up" < Date: Mon, 24 May 2010 21:44:06 GMT < Content-Type: text/html < Content-Length: 19 < basho
  • 9. > GET /riak/gluecon/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/gluecon>; 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 GlueCon</h1> basho
  • 10. Riak was designed to scale horizontally. basho
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. Riak is highly available basho
  • 17.
  • 18.
  • 19.
  • 20. #Replicas - N R+W > N #Get response - R #Put responses - W for quorum
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. Query your data with map/reduce basho
  • 27. basho
  • 28. 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
  • 29. 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
  • 30. map() map() map() map() map() map() map() map() basho
  • 31. R1 R8 R2 R7 R3 R6 R4 R5 basho
  • 32. 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
  • 34. ch ild people/dean child chi ld people/bob people/alice people/claire basho
  • 35. he r m ot ch ild father people/dean child mo the r chi ld people/bob people/alice people/claire basho
  • 36. he r hild m ot gra ndc 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
  • 37. 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
  • 38. 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,_/_,child,_ key link1 link1 link2 link2 bucket tag bucket tag people/claire basho
  • 39. 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,1/people,child,_ people/claire basho
  • 40. CLIENT LIBRARIES Ruby Javascript Java .NET linq Twisted Python basho
  • 41. http://wiki.basho.com follow twitter.com/basho/team riak-users@lists.basho.com #riak on Freenode basho

Notas do Editor

  1. Inspired by the paper Amazon wrote about developing their Dynamo system.
  2. One common encoding is JSON, but you can use what you&amp;#x2019;d like.
  3. Applications can use the content type to decide how to decode the value. We call the combination of key/bucket/value/metadata a Riak Object. One of the things we use the metadata for is to make a nice restful HTTP interface.
  4. Here&amp;#x2019;s an example - if we stored an HTML fragment under they key greeting, in the bucket gluecon
  5. The additional metadata lets us generate a nice HTTP response. Riak plays very well with the web.
  6. The additional metadata lets us generate a nice HTTP response. Riak plays very well with the web.
  7. Riak is a decentralized key/value store. It uses distributed hashing to spread the data across all available machines. All nodes are the same and we have no single points of failure.
  8. From an operations point of view, adding a node is as simple as configuring the base operating system, installing riak and joining the new node to the cluster.
  9. There are no replication topologies to update. Data is automatically migrated to new nodes.
  10. Add more nodes for extra capacity or lowering latency.
  11. And when your spike is over, Riak scales back down again.
  12. Once you have multiple nodes, you get reliability. Riak can store multiple copies of your data. get/put/delete operations request each of the replicas and make sure they are all up to date.
  13. The N value stores how many replicas of each key are stored. As nodes may come and go, there is a chance of the cluster containing stale data or conflicts. Riak handles this by versioning objects with vector clocks and requesting all N objects. Using the vector clock we can tell if the data is just stale or in conflict. Riak can handle this with a last timestamp wins strategy or provide the conflicts back to the application.
  14. Dealing with clusters increases your chance of something failing. In Riak when a node becomes unavailable, another node takes over for it.
  15. If the failure is temporary and the node comes back, the data it missed is returned to it. Or it can be removed from the cluster and the other nodes will take over for it permanently.
  16. If the failure is temporary and the node comes back, the data it missed is returned to it. Or it can be removed from the cluster and the other nodes will take over for it permanently.
  17. The get/put/delete operations in Riak access data by primary key. Most applications need more. Riak has an implementation of map/reduce that allows you to visit each key in a bucket in a map phase extract any information you&amp;#x2019;d like from it (possibly none) and then combine the results in a reduce phase.
  18. map and reduce functions can be written in Javascript or Erlang. The work of mapping is distributed to all nodes in the cluster. The results of the map are streamed to one node for the reduce().
  19. map and reduce functions can be written in Javascript or Erlang. The work of mapping is distributed to all nodes in the cluster. The results of the map are streamed to one node for the reduce().
  20. map and reduce functions can be written in Javascript or Erlang. The work of mapping is distributed to all nodes in the cluster. The results of the map are streamed to one node for the reduce().
  21. map and reduce functions can be written in Javascript or Erlang. The work of mapping is distributed to all nodes in the cluster. The results of the map are streamed to one node for the reduce().
  22. map and reduce functions can be written in Javascript or Erlang. The work of mapping is distributed to all nodes in the cluster. The results of the map are streamed to one node for the reduce().
  23. map and reduce functions can be written in Javascript or Erlang. The work of mapping is distributed to all nodes in the cluster. The results of the map are streamed to one node for the reduce().
  24. map and reduce functions can be written in Javascript or Erlang. The work of mapping is distributed to all nodes in the cluster. The results of the map are streamed to one node for the reduce().
  25. map and reduce functions can be written in Javascript or Erlang. The work of mapping is distributed to all nodes in the cluster. The results of the map are streamed to one node for the reduce().
  26. map and reduce functions can be written in Javascript or Erlang. The work of mapping is distributed to all nodes in the cluster. The results of the map are streamed to one node for the reduce().
  27. As they say, no riak object is an island. Application care about relationships in their data. Riak can store one way &amp;#x2018;links&amp;#x2019; in the object metadata, pointing to another bucket/key. Each link has a tag and there can be many objects. Riak can combine map/reduce with object metadata to handle relationships between them and we have a special link walking interface included in our HTTP interace.
  28. Here&amp;#x2019;s an example using biological relationships. The first set of links store children.
  29. but links are one way, so if you want to get back you have to add more links.
  30. and more links - however it makes sense to use them
  31. We expose links through map/reduce and directly over our HTTP interface We can
  32. You can also return intermediate steps - after the trailing comma for the observant of you.
  33. Riak has clients in many languages that are supported by the Basho team and there are also community provided ones springing up too.
  34. That&amp;#x2019;s about all I could show you in 10 minutes - please visit our website and check us out. We have a FastTrack section on our wiki to go through all you need to get started. Thank you for listening.