SlideShare ist ein Scribd-Unternehmen logo
1 von 65
Building Web Apps for a
      LOT of Users
       Jon Tirsen, Google
read-mostly            read-write
       private               social
“personal” computing   “cloud” computing
We’ve had 112 visitors today!
Scalability
Counter


+1     112


Front End
Counter


            +1     112


Front End   Front End    Front End
Counter


            +1     112


Front End   Front End    Front End

Front End   Front End    Front End
Counter


            +1     112


Front End   Front End    Front End

Front End   Front End    Front End

Front End   Front End    Front End
Counter     Counter     Counter




Front End   Front End   Front End

Front End   Front End   Front End

Front End   Front End   Front End
Counter       Counter        Counter


                          rite
                         W
             Front End

          Shard by: random
Counter     Counter      Counter




           Front End

          Read fan out
Front end     Counter   Counter   Counter




            Blocking reads
Front end    Counter   Counter   Counter




            Async reads
Counter   Counter     Counter




          Front End

           Write
Counter   Counter     Counter




          Front End

            Read
Availability
Availability




               1   Number of shards   1000
Availability




                   99%

               1         Number of shards   1000
Availability




                         14 mins/day
                         7 hours/month
                   99% = 3 days/year

               1         Number of shards   1000
Availability




                            Writing


                   99%

               1         Number of shards   1000
Availability




                            Writing


                   99%

               1         Number of shards   1000
Availability                          99.9999...%




                            Writing


                   99%

               1         Number of shards   1000
Read fan out
Availability




               1   Number of shards   1000
Read fan out
Availability




               1   Number of shards   1000
99%
                         Read fan out
Availability




               1         Number of shards   1000
99%
                          Read fan out
Availability




                         60%




               1          Number of shards   1000
99%
                          Read fan out
Availability




                         60%

                               0.6%




               1          Number of shards   1000
99%
                          Read fan out
Availability




                         60%

                               0.6%
                                                    0.004%


               1          Number of shards   1000
Update

Counter    Counter     Counter

Replicas
 Replica
 Replica   Replicas
            Replica        Replicas
                            Replica
                            Replica
            Replica
                       Write
   Reads

           Front End
Availability




                   Read fan out
                   to 5 replicas



               1   Number of shards   1000
Availability   8 nines




                         Read fan out
                         to 5 replicas



               1         Number of shards   1000
8 nines

                     6 nines
Availability




                         Read fan out
                         to 5 replicas



               1         Number of shards   1000
8 nines         5 nines
                     6 nines
Availability




                         Read fan out
                         to 5 replicas



               1         Number of shards   1000
8 nines         5 nines
                                            99.99%
                     6 nines
Availability




                         Read fan out
                         to 5 replicas



               1         Number of shards   1000
Read & Cache


      Counter   Counter        Counter




                                    ad
                                    Re
                               &
                                e
                             rit
                            W
                Front End
Availability                          99.9999...%




                         Read fan out
                         with caching

                   99%

               1         Number of shards   1000
Consistency
Read
Probability




              Write   Write   Write   Write
Read
Probability




              Write   Write   Write   Write
Read
Probability




              Write   Write   Write   Write
200
299      52       Cached: 299




      Front End
200
299      52       Cached: 299, 52




      Front End
200
299      56       Cached: 299, 52




      Front End
200
302      56       Cached: 299, 52




      Front End
201
302      56        Cached: 299, 52




              +1
      Front End
201
302      56        Cached: 299, 52




              +1


                        2
                      55
      Front End
201
302      56        Cached: 299, 52




              +1




                             2 01
                        +5 2
                          2+
                      99 55
      Front End


                    =2
A different solution...
Rea
                                 d   &s
                                        um

                 Analyser
                 Analyser
                 Analysers                   Logs
                                             Logs
                                              Logs
Push new count




                                                     nd
                                                   pe
                                                 Ap
   Front End     Front End    Front End
Front End         Counter




Front End        Log      Analyser
Analyser

                            Push new count


Front End    Front End      Front End

            Write fan out
Sharding
            Fan out: writes, reads
              Replication/Caching
Shard selection: random, by user, by document
   Consistency model: eventual, shard local
                Sync -> Async
Sharding
            Fan out: writes, reads
              Replication/Caching
Shard selection: random, by user, by document
   Consistency model: eventual, shard local
                Sync -> Async

                 Questions?

             tirsen@google.com

Weitere ähnliche Inhalte

Kürzlich hochgeladen

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 WorkerThousandEyes
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
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
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
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
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Kürzlich hochgeladen (20)

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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
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...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - 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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
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...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
+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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Empfohlen

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
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Empfohlen (20)

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...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Building Web Apps for a LOT of Users

  • 1. Building Web Apps for a LOT of Users Jon Tirsen, Google
  • 2. read-mostly read-write private social “personal” computing “cloud” computing
  • 3.
  • 4. We’ve had 112 visitors today!
  • 6. Counter +1 112 Front End
  • 7. Counter +1 112 Front End Front End Front End
  • 8. Counter +1 112 Front End Front End Front End Front End Front End Front End
  • 9. Counter +1 112 Front End Front End Front End Front End Front End Front End Front End Front End Front End
  • 10. Counter Counter Counter Front End Front End Front End Front End Front End Front End Front End Front End Front End
  • 11. Counter Counter Counter rite W Front End Shard by: random
  • 12.
  • 13.
  • 14. Counter Counter Counter Front End Read fan out
  • 15. Front end Counter Counter Counter Blocking reads
  • 16. Front end Counter Counter Counter Async reads
  • 17.
  • 18. Counter Counter Counter Front End Write
  • 19. Counter Counter Counter Front End Read
  • 21. Availability 1 Number of shards 1000
  • 22. Availability 99% 1 Number of shards 1000
  • 23. Availability 14 mins/day 7 hours/month 99% = 3 days/year 1 Number of shards 1000
  • 24. Availability Writing 99% 1 Number of shards 1000
  • 25. Availability Writing 99% 1 Number of shards 1000
  • 26. Availability 99.9999...% Writing 99% 1 Number of shards 1000
  • 27. Read fan out Availability 1 Number of shards 1000
  • 28. Read fan out Availability 1 Number of shards 1000
  • 29. 99% Read fan out Availability 1 Number of shards 1000
  • 30. 99% Read fan out Availability 60% 1 Number of shards 1000
  • 31. 99% Read fan out Availability 60% 0.6% 1 Number of shards 1000
  • 32. 99% Read fan out Availability 60% 0.6% 0.004% 1 Number of shards 1000
  • 33. Update Counter Counter Counter Replicas Replica Replica Replicas Replica Replicas Replica Replica Replica Write Reads Front End
  • 34. Availability Read fan out to 5 replicas 1 Number of shards 1000
  • 35. Availability 8 nines Read fan out to 5 replicas 1 Number of shards 1000
  • 36. 8 nines 6 nines Availability Read fan out to 5 replicas 1 Number of shards 1000
  • 37. 8 nines 5 nines 6 nines Availability Read fan out to 5 replicas 1 Number of shards 1000
  • 38. 8 nines 5 nines 99.99% 6 nines Availability Read fan out to 5 replicas 1 Number of shards 1000
  • 39. Read & Cache Counter Counter Counter ad Re & e rit W Front End
  • 40. Availability 99.9999...% Read fan out with caching 99% 1 Number of shards 1000
  • 41.
  • 43. Read Probability Write Write Write Write
  • 44. Read Probability Write Write Write Write
  • 45. Read Probability Write Write Write Write
  • 46.
  • 47. 200 299 52 Cached: 299 Front End
  • 48. 200 299 52 Cached: 299, 52 Front End
  • 49. 200 299 56 Cached: 299, 52 Front End
  • 50. 200 302 56 Cached: 299, 52 Front End
  • 51. 201 302 56 Cached: 299, 52 +1 Front End
  • 52. 201 302 56 Cached: 299, 52 +1 2 55 Front End
  • 53. 201 302 56 Cached: 299, 52 +1 2 01 +5 2 2+ 99 55 Front End =2
  • 54.
  • 55.
  • 56.
  • 57.
  • 59. Rea d &s um Analyser Analyser Analysers Logs Logs Logs Push new count nd pe Ap Front End Front End Front End
  • 60. Front End Counter Front End Log Analyser
  • 61. Analyser Push new count Front End Front End Front End Write fan out
  • 62.
  • 63.
  • 64. Sharding Fan out: writes, reads Replication/Caching Shard selection: random, by user, by document Consistency model: eventual, shard local Sync -> Async
  • 65. Sharding Fan out: writes, reads Replication/Caching Shard selection: random, by user, by document Consistency model: eventual, shard local Sync -> Async Questions? tirsen@google.com

Hinweis der Redaktion

  1. Hello
  2. All generalizations are lies but there is a shift in what type of web apps we’re building today. Moving from read-mostly to a read-write web. The old web displayed content to the user had limited points of interaction (shopping carts, TODO etc). The new web invites us to interact everywhere. This means that in general we’re going to see a larger proportion of writes to our reads. We’re also moving from web apps that are largely private (TODO improve this argument) to social apps that have a lot of “cross user” behavior which as we will see is notoriously hard to scale. And lastly, a lot of software we previously used on our “PC” now run on datacenters hosted by another company.
  3. You may be aware of... Image - edge cache Search engine - read-only Visitors today - not real number
  4. Read -> Increase -> Write Writes bottleneck
  5. Read -> Increase -> Write Writes bottleneck
  6. Read -> Increase -> Write Writes bottleneck
  7. Read -> Increase -> Write Writes bottleneck
  8. Read -> Increase -> Write Writes bottleneck
  9. Read -> Increase -> Write Writes bottleneck
  10. Read -> Increase -> Write Writes bottleneck
  11. Read -> Increase -> Write Writes bottleneck
  12. Split How do we implement this?
  13. First write Select by - random fine
  14. Inbox, contacts, labels - by user IM conversation - shared between two users
  15. Doclist - by user Documents shared - by document
  16. Sum - need fan out
  17. Side story Serial fan out Latency = O(n) with fan out size
  18. Parallel fan out Latency = O(1) with fan out size Threads no good: 1000 r/s w 1s latency * 1000 shard fan out = need 1 million threads Async I/O and RPC library Futures
  19. Write - your shard Fan out - by follower
  20. Writes scale by adding new shards
  21. Reads - still hit all shards Reads faster and no need for locks Still limit to scale We’ll get to that but not our biggest problem...
  22. TADA! Let’s have a look at our availability
  23. Availability as we grow 99% downtime one machine
  24. Availability as we grow 99% downtime one machine
  25. “What’s the probability all shards are down?” Writes look good 1000 nines uptime
  26. “What’s the probability all shards are down?” Writes look good 1000 nines uptime
  27. “What’s the no shard is down?” 50 - 60% - retry 500 - 0.6% - ouch 1000 - 0.004% - impossible Probability -> inevitability
  28. “What’s the no shard is down?” 50 - 60% - retry 500 - 0.6% - ouch 1000 - 0.004% - impossible Probability -> inevitability
  29. “What’s the no shard is down?” 50 - 60% - retry 500 - 0.6% - ouch 1000 - 0.004% - impossible Probability -> inevitability
  30. “What’s the no shard is down?” 50 - 60% - retry 500 - 0.6% - ouch 1000 - 0.004% - impossible Probability -> inevitability
  31. “What’s the no shard is down?” 50 - 60% - retry 500 - 0.6% - ouch 1000 - 0.004% - impossible Probability -> inevitability
  32. Write -> Replica Read across 5 replicas
  33. Same curve much higher up Same as GFS and BigTable Would work Each shard has little data so...
  34. Same curve much higher up Same as GFS and BigTable Would work Each shard has little data so...
  35. Same curve much higher up Same as GFS and BigTable Would work Each shard has little data so...
  36. Same curve much higher up Same as GFS and BigTable Would work Each shard has little data so...
  37. Cache at each shard Each shard - return full sum
  38. Disregard cache refresh Same uptime as writes Cache refresh error rate limits scale (very high!)
  39. Twitter availability - cheap shot People blame Rails Caching was their problem
  40. “Cache” -> “Consistency”
  41. A series of writes One read Which write do we get?
  42. Simple definition: This is “consistent”
  43. “Eventual” consistency - stop writing and you read last write Never stop writing Our consistency
  44. Multiple shards System-wide state returned was never assumed Has interesting property -> example
  45. We get a request Cache 299
  46. Cache 52
  47. Get some requests 52 -> 56
  48. Get some requests 299 -> 302
  49. Detail on one request Bump up 200 -> 201 Get back 552 Cached: 299, 52 Look at that: it’s the last write!
  50. Detail on one request Bump up 200 -> 201 Get back 552 Cached: 299, 52 Look at that: it’s the last write!
  51. Detail on one request Bump up 200 -> 201 Get back 552 Cached: 299, 52 Look at that: it’s the last write!
  52. Consistent in our own shard “Shard local” consistency model Same as AppEngine’s data store
  53. Write message -> see it immediately Others trickle in as those caches refresh
  54. Shopping cart can’t be inconsistent
  55. Withdraw money from paypal can’t be consistent
  56. TADA! Let’s have a look at our availability
  57. “Completely different” Front end logs Analysers sum up Push to front end “Not so different” - two new tricks
  58. Detach from fulfilling request Append cheaper Shard logs Shard analysers
  59. Write fan out Same availability as read fan out but not critical At front end failure - skip and it serves out of date value
  60. The “bought together”, “searched for” and so forth sections of the Amazon webpages are of course the results of massive log analysis. These don’t happen as part of the request but are rather executed in the backend and pushed to the shards serving those product pages.