SlideShare uma empresa Scribd logo
1 de 20
NoSQL at LucidMedia
       Nick Kleinschmidt

            @kleinsch
    nkleinsch@lucidmedia.com
Overview
• Who is LucidMedia?
• What is NoSQL?
• Major NoSQL Products
• Performance Results
• Pro Tips
• Questions
LucidMedia

•   Online Display
    Advertising Network

•   Over 1.5B impressions/
    day

•   Based in Reston, VA

•   Hiring engineers!
Real Time Bidding
The Use Case

• Server-side user database (cookie store)
• Hundreds of millions of users
• Fast access - 5-10ms
• Cloud hardware
What is NoSQL?

• Data storage tools created in reaction to
  common web scaling problems with
  relational databases
• Widely differing purposes and feature sets
Problem: Scaling Writes

• Relational databases scale vertically - all
  records must be on the same machine
• Solution - distribute data across machines,
  scaling horizontally
• This solves the scaling problem, but makes
  joins, grouping, transactions difficult
Problem: High Latency
• Database is usually biggest contributor to
  server-side application latency
• memcached pioneered low latency key-
  value store
• Solution - compromise functionality for
  speed
• Usually sacrifice transactions, advanced
  query types
Problem: Inflexible
        Schemas
• Relational databases require schema to be
  defined ahead of time
• Flexible schema gives more options to
  developers, handle upgrades in code instead
  of writing SQL
• Storing custom formats can save lots of
  space for records with sparse fields
General NoSQL
         Features
• Storage Format / Operations
• Memory / Disk Utilization
• Atomic Operations
• Auto-Sharding - Partitioning data across
  servers, scales reads and writes
• Replication - Copying data between
  servers, scales reads
Types of Products
  Key-Value        Document       Graph
• memcached    •   MongoDB    •   FlockDB
•    Redis     •   CouchDB    •    Neo4j
• BerkeleyDB
•   HBase
• Cassandra
• Amazon
   SimpleDB
Evaluation - Lucidmedia
• Query latency is priority #1
• Disk access is suspect, since we’re in the
  cloud
• Transactions not necessary - it’s OK to be
  briefly inconsistent or even lose a few
  updates
• Replication and auto-sharding are nice, but
  also can be done manually
Products Evaluated
                                             Complex             Storage         Scalability
              Type      Data Storage                                                               License        Used By
                                            Operations           Profile           Features



                          LRU cache                                                                               Facebook,
                                            Check and set                                        Open Source
memcached   Key-Value   mapping string
                                               (CAS)
                                                              All in memory         None
                                                                                                   (BSD)
                                                                                                                    Twitter,
                        to binary data                                                                             YouTube



                                             Indexing on
                            BSON            multiple fields,
                                                                 Disk and
            Document    objects(binary       MapReduce,                         Auto-Sharding,   Commercial,     FourSquare,
MongoDB       Store     format similar          atomic
                                                                 memory
                                                                                 Replication       AGPL        bit.ly, ShutterFly
                          to JSON)            operations
                                            (single object)

                        Column family
                                               Tunable
                        store - similar
            Key-Value                        consistency,        Disk and                                         Facebook
                         to BigTable,                                            Clustered,      Open Source
Cassandra   (Column
                         multiple data
                                               atomic            memory
                                                                                 Replication      (Apache)
                                                                                                                Inbox Search,
             Store)                          operations                                                          Digg, Twitter
                           types for
                                             (row level)
                           columns

                                                                                  Replication,
                          Simple key-
                                            Many atomic       All in memory,       Cluster
                        value, supports                                                          Open Source    GitHub, Digg,
  Redis     Key-Value
                        list, set, sorted
                                             operations        saved to disk     (unreleased)
                                                                                                   (BSD)         LucidMedia
                                            (single key)      for persistence    will provide
                            set, hash
                                                                                auto-sharding
Findings
                            Pros                                 Cons                      Using It?
                                                        We need more than a cache,
memcached      Fast, widely used, great for caching      MemcacheDB didn’t seem           Yes (for other things)
                                                          widely used at the time




            Great data model and feature set, strong   Early versions had performance
MongoDB               commercial support                            issues
                                                                                                   No




                                                           Not optimized for our
             Great for storing and searching huge
Cassandra              amounts of data
                                                       problem, so performance didn’t              No
                                                                fit our needs




                                                       No auto-sharding (yet), memory
            Lightning fast, very active development,
  Redis                 useful feature set
                                                        footprint (per key) is a little            Yes
                                                                    high
Performance - GET
                                    MySQL (InnoDB)            Memcached            Redis

                        6000
Throughput (reqs/sec)




                        4500


                        3000


                        1500


                           0
                               10          20              30             40               60
                                                 Concurrency (threads)
                                                                          http://www.ruturaj.net/myisam-innodb
Performance - SET
                                    MySQL (InnoDB)            Memcached            Redis

                        6000
Throughput (reqs/sec)




                        4500


                        3000


                        1500


                           0
                               10          20              30             40               60
                                                 Concurrency (threads)
                                                                          http://www.ruturaj.net/myisam-innodb
Performance Testing

• Use real application data
• Approximate real conditions - run against
  your web servers, not a simple test
  program
• Averages hide important details - use
  percentiles to measure latency
Drivers
•   Huge performance                                   Whalin           SpyMemcached
    difference between
    drivers for the same                      6
    language



                              Latency (ms)
                                             4.5
•   Use asynchronous driver
    when possible to                          3
    parallelize requests
                                             1.5

                                              0
                                                   1            10            20        30
                                                                Concurrency (threads)
Sharding

• Split into a large number of shards initially,
  since you’re going to reshard eventually
• Automate shard management processes
• Measure performance and utilization
  metrics in production to predict scaling
  needs
Questions?


• @kleinsch
• nkleinsch@lucidmedia.com

Mais conteúdo relacionado

Último

Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
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
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Último (20)

Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
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
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

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

Big Data DC - NoSQL at LucidMedia

  • 1. NoSQL at LucidMedia Nick Kleinschmidt @kleinsch nkleinsch@lucidmedia.com
  • 2. Overview • Who is LucidMedia? • What is NoSQL? • Major NoSQL Products • Performance Results • Pro Tips • Questions
  • 3. LucidMedia • Online Display Advertising Network • Over 1.5B impressions/ day • Based in Reston, VA • Hiring engineers!
  • 5. The Use Case • Server-side user database (cookie store) • Hundreds of millions of users • Fast access - 5-10ms • Cloud hardware
  • 6. What is NoSQL? • Data storage tools created in reaction to common web scaling problems with relational databases • Widely differing purposes and feature sets
  • 7. Problem: Scaling Writes • Relational databases scale vertically - all records must be on the same machine • Solution - distribute data across machines, scaling horizontally • This solves the scaling problem, but makes joins, grouping, transactions difficult
  • 8. Problem: High Latency • Database is usually biggest contributor to server-side application latency • memcached pioneered low latency key- value store • Solution - compromise functionality for speed • Usually sacrifice transactions, advanced query types
  • 9. Problem: Inflexible Schemas • Relational databases require schema to be defined ahead of time • Flexible schema gives more options to developers, handle upgrades in code instead of writing SQL • Storing custom formats can save lots of space for records with sparse fields
  • 10. General NoSQL Features • Storage Format / Operations • Memory / Disk Utilization • Atomic Operations • Auto-Sharding - Partitioning data across servers, scales reads and writes • Replication - Copying data between servers, scales reads
  • 11. Types of Products Key-Value Document Graph • memcached • MongoDB • FlockDB • Redis • CouchDB • Neo4j • BerkeleyDB • HBase • Cassandra • Amazon SimpleDB
  • 12. Evaluation - Lucidmedia • Query latency is priority #1 • Disk access is suspect, since we’re in the cloud • Transactions not necessary - it’s OK to be briefly inconsistent or even lose a few updates • Replication and auto-sharding are nice, but also can be done manually
  • 13. Products Evaluated Complex Storage Scalability Type Data Storage License Used By Operations Profile Features LRU cache Facebook, Check and set Open Source memcached Key-Value mapping string (CAS) All in memory None (BSD) Twitter, to binary data YouTube Indexing on BSON multiple fields, Disk and Document objects(binary MapReduce, Auto-Sharding, Commercial, FourSquare, MongoDB Store format similar atomic memory Replication AGPL bit.ly, ShutterFly to JSON) operations (single object) Column family Tunable store - similar Key-Value consistency, Disk and Facebook to BigTable, Clustered, Open Source Cassandra (Column multiple data atomic memory Replication (Apache) Inbox Search, Store) operations Digg, Twitter types for (row level) columns Replication, Simple key- Many atomic All in memory, Cluster value, supports Open Source GitHub, Digg, Redis Key-Value list, set, sorted operations saved to disk (unreleased) (BSD) LucidMedia (single key) for persistence will provide set, hash auto-sharding
  • 14. Findings Pros Cons Using It? We need more than a cache, memcached Fast, widely used, great for caching MemcacheDB didn’t seem Yes (for other things) widely used at the time Great data model and feature set, strong Early versions had performance MongoDB commercial support issues No Not optimized for our Great for storing and searching huge Cassandra amounts of data problem, so performance didn’t No fit our needs No auto-sharding (yet), memory Lightning fast, very active development, Redis useful feature set footprint (per key) is a little Yes high
  • 15. Performance - GET MySQL (InnoDB) Memcached Redis 6000 Throughput (reqs/sec) 4500 3000 1500 0 10 20 30 40 60 Concurrency (threads) http://www.ruturaj.net/myisam-innodb
  • 16. Performance - SET MySQL (InnoDB) Memcached Redis 6000 Throughput (reqs/sec) 4500 3000 1500 0 10 20 30 40 60 Concurrency (threads) http://www.ruturaj.net/myisam-innodb
  • 17. Performance Testing • Use real application data • Approximate real conditions - run against your web servers, not a simple test program • Averages hide important details - use percentiles to measure latency
  • 18. Drivers • Huge performance Whalin SpyMemcached difference between drivers for the same 6 language Latency (ms) 4.5 • Use asynchronous driver when possible to 3 parallelize requests 1.5 0 1 10 20 30 Concurrency (threads)
  • 19. Sharding • Split into a large number of shards initially, since you’re going to reshard eventually • Automate shard management processes • Measure performance and utilization metrics in production to predict scaling needs

Notas do Editor

  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
  17. \n
  18. \n
  19. \n
  20. \n