SlideShare una empresa de 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

Más contenido relacionado

Último

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
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, Adobeapidays
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
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...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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
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 Processorsdebabhi2
 
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...Martijn de Jong
 
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...DianaGray10
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 

Último (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
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
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
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...
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
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
 
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...
 
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...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Destacado

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
 

Destacado (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 del 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