SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Real World Redis




Ara Anjargolian
Co-Founder & C TO, YCharts
The typical SQL/NoSQL breakdown

            SQL                          NoSQL

      Single machine         Multi-machine / Distributed

                               Non-relational, references
         Relational
                                       possible
                               Key-value, column-store,
          Tables
                                   document store

 On disk storage + cache.      On disk storage + cache.


            ACID                          BASE
  (Atomicity, Consistency,   (Basically available, Soft state,
    Isolation, Durability)        Eventual consistency
So what is Redis?
Redis is often called a data structure server.

That is, a database that hosts a set of handy data
structures and extremely useful operations on said
structures.
Where does Redis fit in?
           Redis                           NoSQL

  Single machine, for now.     Multi-machine / Distributed

                                 Non-relational, references
       Non-relational
                                         possible
                                 Key-value, column store,
       Key-value+++
                                     document store

In memory + disk persistence     On disk storage + cache.


                                            BASE
  RDB dump. AOF. Or both.      (Basically available, Soft state,
                                   Eventual consistency)
Introducing Redis into your
production environment.
•   Step 1: Find one cool use case for Redis.

•   Step 2: Implement and deploy

•   Step 3: Find 5 other ways where Redis gives your
    app/company a unique advantage.



At YCharts, we use Redis in 6 distinct,
unrelated ways.
Data structures
•   Key/value

•   Lists

•   Sets

•   Sorted Set

•   Hashes

•   Pub/sub
Key/value
Functionality
•   Basic set/get

•   Keys can expire or not

•   Atomic increment/decrement


Use cases
•   Store sparse/one off data: We use it store global site
    settings that we wan’t to change on the fly.

•   Cache backends: People use it as memcached
    replacement, or to save user sessions.

•   Really fast, hit counters. Think logging, monitoring,
    etc.
Lists
Functionality
•   Atomic push/pop

•   Set/get by index.

•   Sort.


Use cases
•   We use it as a queue backend. See hotqueue or
    celery.
Sets
Functionality
•   Add/remove.

•   Intersect, union, intersect + store, union + store.

•   Sort.


Use cases
•   We use it to intersects lists of stocks for screening
    functionality of our site.

•   Good for anything else sets might be used for
    normally.
Sorted sets
Functionality
•   Add/remove/get rank by score.

•   Get/remove range of members, by score or reversed
    score.

•   Union/intersect.


Use cases
•   Autocompleters that sort by arbitrary metric. We use
    them for fast autocompleter that sorts by company
    market cap.

•   Really fast range queries. We use it for filtering
    metrics on our stock screener.

•   Leaderboards for games.
Hashes
Functionality
•   Set/delete field of hash.

•   Set/get multiple fields of hash.

•   Increment field.


Use cases
•   Tabular or column oriented data.

•   We use it to store output of various site usage
    reports. Also use it, in essence, as key space for
    autocompleter.
Pub/sub
Functionality
•   Multiple clients can listen for messages published on
    a named channel


Use cases
•   Streaming / real-time data.

•   Stock quotes: One channel per stock symbol ...
    multiple browser client listeners. We will use it soon
    for this!

•   Alerts: One channel / user.
Other cool stuff
•   Transactions. Atomic execution of multiple
    commands.

•   Variadic functions. Lots of operations, for examples
    Adding a member to a set or list, have versions
    where you can add multiple items at once.

•   Pipelining. To avoid constant network back/forth,
    commands in Redis can be grouped together and
    results gotten back in one response. Basically can
    fake variadic behavior w/o having actual variadic
    functions.
Deployment notes
•   Most importantly: Redis is very fast and stable.

•   Compile from source. Code too fast to use OS
    packaged versions.

•   Remember it’s a memory DB, so must have as much
    memory as data you’re going to hold.

•   It’s fast out of the box, tuning is more command
    level then system level.

•   Most important system setting is level of data
    persistence.

•   To optimize, make sure you are using variadic
    functionality, and where not available, pipelining.

•   Replication is an option for data durability.
The future
•   Redis 2.6. Lua scripting for advanced operations.

•   Redis-cluster. Multi-machine / distributed Redis.
    Being (very) actively developed.
The end.
Questions or comments? Contact ara @ ycharts.com

p.s. YCharts is hiring!

Weitere ähnliche Inhalte

Kürzlich hochgeladen

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
vu2urc
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

Empfohlen

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
ThinkNow
 
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
Kurio // The Social Media Age(ncy)
 

Empfohlen (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...
 

Real World Redis

  • 1. Real World Redis Ara Anjargolian Co-Founder & C TO, YCharts
  • 2. The typical SQL/NoSQL breakdown SQL NoSQL Single machine Multi-machine / Distributed Non-relational, references Relational possible Key-value, column-store, Tables document store On disk storage + cache. On disk storage + cache. ACID BASE (Atomicity, Consistency, (Basically available, Soft state, Isolation, Durability) Eventual consistency
  • 3. So what is Redis? Redis is often called a data structure server. That is, a database that hosts a set of handy data structures and extremely useful operations on said structures.
  • 4. Where does Redis fit in? Redis NoSQL Single machine, for now. Multi-machine / Distributed Non-relational, references Non-relational possible Key-value, column store, Key-value+++ document store In memory + disk persistence On disk storage + cache. BASE RDB dump. AOF. Or both. (Basically available, Soft state, Eventual consistency)
  • 5. Introducing Redis into your production environment. • Step 1: Find one cool use case for Redis. • Step 2: Implement and deploy • Step 3: Find 5 other ways where Redis gives your app/company a unique advantage. At YCharts, we use Redis in 6 distinct, unrelated ways.
  • 6. Data structures • Key/value • Lists • Sets • Sorted Set • Hashes • Pub/sub
  • 7. Key/value Functionality • Basic set/get • Keys can expire or not • Atomic increment/decrement Use cases • Store sparse/one off data: We use it store global site settings that we wan’t to change on the fly. • Cache backends: People use it as memcached replacement, or to save user sessions. • Really fast, hit counters. Think logging, monitoring, etc.
  • 8. Lists Functionality • Atomic push/pop • Set/get by index. • Sort. Use cases • We use it as a queue backend. See hotqueue or celery.
  • 9. Sets Functionality • Add/remove. • Intersect, union, intersect + store, union + store. • Sort. Use cases • We use it to intersects lists of stocks for screening functionality of our site. • Good for anything else sets might be used for normally.
  • 10. Sorted sets Functionality • Add/remove/get rank by score. • Get/remove range of members, by score or reversed score. • Union/intersect. Use cases • Autocompleters that sort by arbitrary metric. We use them for fast autocompleter that sorts by company market cap. • Really fast range queries. We use it for filtering metrics on our stock screener. • Leaderboards for games.
  • 11. Hashes Functionality • Set/delete field of hash. • Set/get multiple fields of hash. • Increment field. Use cases • Tabular or column oriented data. • We use it to store output of various site usage reports. Also use it, in essence, as key space for autocompleter.
  • 12. Pub/sub Functionality • Multiple clients can listen for messages published on a named channel Use cases • Streaming / real-time data. • Stock quotes: One channel per stock symbol ... multiple browser client listeners. We will use it soon for this! • Alerts: One channel / user.
  • 13. Other cool stuff • Transactions. Atomic execution of multiple commands. • Variadic functions. Lots of operations, for examples Adding a member to a set or list, have versions where you can add multiple items at once. • Pipelining. To avoid constant network back/forth, commands in Redis can be grouped together and results gotten back in one response. Basically can fake variadic behavior w/o having actual variadic functions.
  • 14. Deployment notes • Most importantly: Redis is very fast and stable. • Compile from source. Code too fast to use OS packaged versions. • Remember it’s a memory DB, so must have as much memory as data you’re going to hold. • It’s fast out of the box, tuning is more command level then system level. • Most important system setting is level of data persistence. • To optimize, make sure you are using variadic functionality, and where not available, pipelining. • Replication is an option for data durability.
  • 15. The future • Redis 2.6. Lua scripting for advanced operations. • Redis-cluster. Multi-machine / distributed Redis. Being (very) actively developed.
  • 16. The end. Questions or comments? Contact ara @ ycharts.com p.s. YCharts is hiring!

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n