SlideShare une entreprise Scribd logo
1  sur  16
Télécharger pour lire hors ligne
Best Practices for Scaling Websites


                        Randy Shoup
                 eBay Distinguished Architect




QCon Asia 2009
Challenges at Internet Scale


• eBay manages …
  – 86.3 million active users worldwide
  – 120 million items for sale in 50,000 categories
  – Over 2 billion page views per day

    – eBay users trade over $2000 in goods every
      second -- $60 billion per year
    – eBay site stores over 2 PB of data
    – eBay processes 50 TB of new, incremental data
      per day
    – eBay Data Warehouse analyzes 50 PB per day


       • In a dynamic environment
           – 300+ features per quarter
           – We roll 100,000+ lines of code every two weeks

             • In 39 countries, in 8 languages, 24x7x365
                        >48 Billion SQL executions/day!

                                                              © 2009 eBay Inc.
Architectural Forces at Internet Scale

• Scalability
   – Resource usage should increase linearly (or better!) with load
   – Design for 10x growth in data, traffic, users, etc.
• Availability
   – Resilience to failure (MTBF)
   – Rapid recoverability from failure (MTTR)
   – Graceful degradation
• Latency
   – User experience latency
   – Data latency
• Manageability
   – Simplicity
   – Maintainability
   – Diagnostics
• Cost
   – Development effort and complexity
   – Operational cost (TCO)



                                                                      © 2009 eBay Inc.
Best Practices for Scaling



1. Partition Everything
2. Asynchrony Everywhere
3. Automate Everything
4. Remember Everything Fails
5. Embrace Inconsistency




                               © 2009 eBay Inc.
Best Practice 1: Partition Everything


• Split every problem into manageable chunks
   – By data, load, and/or usage pattern
   – “If you can’t split it, you can’t scale it”


• Motivations
   –   Scalability: can scale horizontally and independently
   –   Availability: can isolate failures
   –   Manageability: can decouple different segments and functional areas
   –   Cost: can use less expensive hardware




                                                                             © 2009 eBay Inc.
Best Practice 1: Partition Everything


Pattern: Functional Segmentation
   – Segment processing into pools, services, and stages
   – Segment data along usage boundaries



Pattern: Horizontal Split
   – Load-balance processing
       •   Within a pool, all servers are created equal
   – Split (or “shard”) data along primary access path
       •   Partition by range, modulo of a key, lookup, etc.




Corollary: No Session State
   – User session flow moves through multiple application pools
   – Absolutely no session state in application tier




                                                                  © 2009 eBay Inc.
Best Practice 2: Asynchrony Everywhere

• Prefer Asynchronous Processing
   – Move as much processing as possible to asynchronous flows
   – Where possible, integrate disparate components asynchronously


• Motivations
   – Scalability: can scale components independently
   – Availability
      • Can decouple availability state
      • Can retry operations
   – Latency
      • Can significantly improve user experience latency at cost of data/execution latency
      • Can allocate more time to processing than user would tolerate
   – Cost: can spread peak load over time




                                                                                              © 2009 eBay Inc.
Best Practice 2: Asynchrony Everywhere


Pattern: Event Queue
   – Primary use-case produces event
       •   Create event (ITEM.NEW, ITEM.SOLD) transactionally
           with primary insert/update
   – Consumers subscribe to event
       •   At least once delivery
       •   No guaranteed order
       •   Idempotency and readback


Pattern: Message Multicast
   – Search Feeder publishes item updates
       •   Reads item updates from primary database
       •   Publishes sequenced updates via SRM-inspired protocol
   – Nodes listen to assigned subset of messages
       •   Update in-memory index in real time
       •   Request recovery (NAK) when messages
           are missed




                                                                   © 2009 eBay Inc.
Best Practice 3: Automate Everything

• Prefer Adaptive / Automated Systems to Manual Systems

• Motivations
   – Scalability
      • Can scale with machines, not humans
   – Availability / Latency
      • Can adapt to changing environment more rapidly
   – Cost
      • Machines are far less expensive than humans
      • Can learn / improve / adjust over time without manual effort




                                                                       © 2009 eBay Inc.
Best Practice 3: Automate Everything


Pattern: Adaptive Configuration
   – Define SLA for a given logical consumer
       •   E.g., 99% of events processed in 15 seconds
   – Dynamically adjust config to meet defined SLA




Pattern: Machine Learning
   – Dynamically adapt search experience
       •   Determine best inventory and assemble optimal page for that user
           and context
   – Feedback loop enables system to learn and improve over time
       •   Collect user behavior
       •   Aggregate and analyze offline
       •   Deploy updated metadata
       •   Decide and serve appropriate experience
   – Perturbation and dampening




                                                                              © 2009 eBay Inc.
Best Practice 4: Remember Everything Fails

• Build all systems to be tolerant of failure
   –   Assume every operation will fail and every resource will be unavailable
   –   Detect failure as rapidly as possible
   –   Recover from failure as rapidly as possible
   –   Do as much as possible during failure


• Motivation
   – Availability




                                                                                 © 2009 eBay Inc.
Best Practice 4: Remember Everything Fails


Pattern: Failure Detection
   – Servers log all requests
       •   Log all application activity, database and service calls on
           multicast message bus
       •   Over 2TB of log messages per day
   – Listeners automate failure detection and notification


Pattern: Rollback
   – Absolutely no changes to the site which cannot be undone (!)
   – Every feature has on / off state driven by central configuration
       •   Feature can be immediately turned off for operational or business reasons
       •   Features can be deployed “wired-off” to unroll dependencies


Pattern: Graceful Degradation
   – Application “marks down” an unavailable or distressed resource
   – Non-critical functionality is removed or ignored
   – Critical functionality is retried or deferred




                                                                                       © 2009 eBay Inc.
Best Practice 5: Embrace Inconsistency

• Brewer’s CAP Theorem
  – Any shared-data system can have at most two of the following properties:
     • Consistency: All clients see the same data, even in the presence of updates
     • Availability: All clients will get a response, even in the presence of failures
     • Partition-tolerance: The system properties hold even when the network is partitioned

  – This trade-off is fundamental to all distributed systems




                                                                                              © 2009 eBay Inc.
Best Practice 5: Embrace Inconsistency


Choose Appropriate Consistency Guarantees
   –   To guarantee availability and partition-tolerance, we trade off immediate consistency
   –   Most real-world systems (even financial systems!) do not require immediate consistency
   –   Consistency is a spectrum
   –   Prefer eventual consistency to immediate consistency




Avoid Distributed Transactions
   – eBay does absolutely no distributed transactions – no two-phase commit
   – Minimize inconsistency through state machines and careful ordering of operations
   – Eventual consistency through asynchronous event or reconciliation batch




                                                                                                © 2009 eBay Inc.
Recap: Best Practices for Scaling



1. Partition Everything
2. Asynchrony Everywhere
3. Automate Everything
4. Remember Everything Fails
5. Embrace Inconsistency




                                    © 2009 eBay Inc.
Questions?




 About the Presenter
 Randy Shoup has been the primary architect for eBay's search
 infrastructure since 2004. Prior to eBay, Randy was Chief Architect and
 Technical Fellow at Tumbleweed Communications, and has also held a
 variety of software development and architecture roles at Oracle and
 Informatica.
 rshoup@ebay.com




                                                                       © 2009 eBay Inc.

Contenu connexe

Tendances

1491 - Virtual, Faster, Better! How to Virtualize the Rich Client and Browser...
1491 - Virtual, Faster, Better! How to Virtualize the Rich Client and Browser...1491 - Virtual, Faster, Better! How to Virtualize the Rich Client and Browser...
1491 - Virtual, Faster, Better! How to Virtualize the Rich Client and Browser...Christoph Adler
 
Using Dashboards to Transform Application Data Visualization
Using Dashboards to Transform Application Data VisualizationUsing Dashboards to Transform Application Data Visualization
Using Dashboards to Transform Application Data VisualizationKathy Brown
 
Designing Highly-Available Architectures for OTM
Designing Highly-Available Architectures for OTMDesigning Highly-Available Architectures for OTM
Designing Highly-Available Architectures for OTMMavenWire
 
Scaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsScaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsAchievers Tech
 
Logging Wars: A Cross-Product Tech Clash Between Experts
Logging Wars: A Cross-Product Tech Clash Between Experts Logging Wars: A Cross-Product Tech Clash Between Experts
Logging Wars: A Cross-Product Tech Clash Between Experts Benedek Menesi
 

Tendances (6)

Os(vijayanand)
Os(vijayanand)Os(vijayanand)
Os(vijayanand)
 
1491 - Virtual, Faster, Better! How to Virtualize the Rich Client and Browser...
1491 - Virtual, Faster, Better! How to Virtualize the Rich Client and Browser...1491 - Virtual, Faster, Better! How to Virtualize the Rich Client and Browser...
1491 - Virtual, Faster, Better! How to Virtualize the Rich Client and Browser...
 
Using Dashboards to Transform Application Data Visualization
Using Dashboards to Transform Application Data VisualizationUsing Dashboards to Transform Application Data Visualization
Using Dashboards to Transform Application Data Visualization
 
Designing Highly-Available Architectures for OTM
Designing Highly-Available Architectures for OTMDesigning Highly-Available Architectures for OTM
Designing Highly-Available Architectures for OTM
 
Scaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsScaling High Traffic Web Applications
Scaling High Traffic Web Applications
 
Logging Wars: A Cross-Product Tech Clash Between Experts
Logging Wars: A Cross-Product Tech Clash Between Experts Logging Wars: A Cross-Product Tech Clash Between Experts
Logging Wars: A Cross-Product Tech Clash Between Experts
 

Similaire à E Bay Best Practices For Scaling Websites

eBay’s Challenges and Lessons
eBay’s Challenges and LessonseBay’s Challenges and Lessons
eBay’s Challenges and Lessonshutuworm
 
Best Practices for Large-Scale Web Sites
Best Practices for Large-Scale Web SitesBest Practices for Large-Scale Web Sites
Best Practices for Large-Scale Web SitesCraig Dickson
 
071310 sun d_0930_feldman_stephen
071310 sun d_0930_feldman_stephen071310 sun d_0930_feldman_stephen
071310 sun d_0930_feldman_stephenSteve Feldman
 
10 Tips for Your Journey to the Public Cloud
10 Tips for Your Journey to the Public Cloud10 Tips for Your Journey to the Public Cloud
10 Tips for Your Journey to the Public CloudIntuit Inc.
 
The Hard Problems of Continuous Deployment
The Hard Problems of Continuous DeploymentThe Hard Problems of Continuous Deployment
The Hard Problems of Continuous DeploymentTimothy Fitz
 
Infrastructure as Data with Ansible for easier Continuous Delivery
Infrastructure as Data with Ansible for easier Continuous DeliveryInfrastructure as Data with Ansible for easier Continuous Delivery
Infrastructure as Data with Ansible for easier Continuous DeliveryCarlo Bonamico
 
The Unbearable Lightness of Ephemeral Processing
The Unbearable Lightness of Ephemeral ProcessingThe Unbearable Lightness of Ephemeral Processing
The Unbearable Lightness of Ephemeral ProcessingDataWorks Summit
 
Goal driven performance optimization (Пётр Зайцев)
Goal driven performance optimization (Пётр Зайцев)Goal driven performance optimization (Пётр Зайцев)
Goal driven performance optimization (Пётр Зайцев)Ontico
 
New Approaches to Faster Oracle Forms System Performance
New Approaches to Faster Oracle Forms System PerformanceNew Approaches to Faster Oracle Forms System Performance
New Approaches to Faster Oracle Forms System PerformanceCorrelsense
 
Tiger oracle
Tiger oracleTiger oracle
Tiger oracled0nn9n
 
Building data intensive applications
Building data intensive applicationsBuilding data intensive applications
Building data intensive applicationsAmit Kejriwal
 
Cloud Economics for Java at Java2Days
Cloud Economics for Java at Java2DaysCloud Economics for Java at Java2Days
Cloud Economics for Java at Java2DaysSteve Poole
 
CIRCUIT 2015 - Akamai: Caching and Beyond
CIRCUIT 2015 - Akamai:  Caching and BeyondCIRCUIT 2015 - Akamai:  Caching and Beyond
CIRCUIT 2015 - Akamai: Caching and BeyondICF CIRCUIT
 
Azug - successfully breeding rabits
Azug - successfully breeding rabitsAzug - successfully breeding rabits
Azug - successfully breeding rabitsYves Goeleven
 
S016579 data-optimization-spectrum-control-brazil-v2
S016579 data-optimization-spectrum-control-brazil-v2S016579 data-optimization-spectrum-control-brazil-v2
S016579 data-optimization-spectrum-control-brazil-v2Tony Pearson
 
Refactoring Into Microservices 2016-11-08
Refactoring Into Microservices 2016-11-08Refactoring Into Microservices 2016-11-08
Refactoring Into Microservices 2016-11-08Derek Ashmore
 
Creating a culture of cost management
Creating a culture of cost managementCreating a culture of cost management
Creating a culture of cost managementCloudability
 
Impact 2013 2963 - IBM Business Process Manager Top Practices
Impact 2013 2963 - IBM Business Process Manager Top PracticesImpact 2013 2963 - IBM Business Process Manager Top Practices
Impact 2013 2963 - IBM Business Process Manager Top PracticesBrian Petrini
 

Similaire à E Bay Best Practices For Scaling Websites (20)

eBay’s Challenges and Lessons
eBay’s Challenges and LessonseBay’s Challenges and Lessons
eBay’s Challenges and Lessons
 
Best Practices for Large-Scale Web Sites
Best Practices for Large-Scale Web SitesBest Practices for Large-Scale Web Sites
Best Practices for Large-Scale Web Sites
 
071310 sun d_0930_feldman_stephen
071310 sun d_0930_feldman_stephen071310 sun d_0930_feldman_stephen
071310 sun d_0930_feldman_stephen
 
10 Tips for Your Journey to the Public Cloud
10 Tips for Your Journey to the Public Cloud10 Tips for Your Journey to the Public Cloud
10 Tips for Your Journey to the Public Cloud
 
The Hard Problems of Continuous Deployment
The Hard Problems of Continuous DeploymentThe Hard Problems of Continuous Deployment
The Hard Problems of Continuous Deployment
 
Infrastructure as Data with Ansible for easier Continuous Delivery
Infrastructure as Data with Ansible for easier Continuous DeliveryInfrastructure as Data with Ansible for easier Continuous Delivery
Infrastructure as Data with Ansible for easier Continuous Delivery
 
The Unbearable Lightness of Ephemeral Processing
The Unbearable Lightness of Ephemeral ProcessingThe Unbearable Lightness of Ephemeral Processing
The Unbearable Lightness of Ephemeral Processing
 
Goal driven performance optimization (Пётр Зайцев)
Goal driven performance optimization (Пётр Зайцев)Goal driven performance optimization (Пётр Зайцев)
Goal driven performance optimization (Пётр Зайцев)
 
New Approaches to Faster Oracle Forms System Performance
New Approaches to Faster Oracle Forms System PerformanceNew Approaches to Faster Oracle Forms System Performance
New Approaches to Faster Oracle Forms System Performance
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
Master.pptx
Master.pptxMaster.pptx
Master.pptx
 
Tiger oracle
Tiger oracleTiger oracle
Tiger oracle
 
Building data intensive applications
Building data intensive applicationsBuilding data intensive applications
Building data intensive applications
 
Cloud Economics for Java at Java2Days
Cloud Economics for Java at Java2DaysCloud Economics for Java at Java2Days
Cloud Economics for Java at Java2Days
 
CIRCUIT 2015 - Akamai: Caching and Beyond
CIRCUIT 2015 - Akamai:  Caching and BeyondCIRCUIT 2015 - Akamai:  Caching and Beyond
CIRCUIT 2015 - Akamai: Caching and Beyond
 
Azug - successfully breeding rabits
Azug - successfully breeding rabitsAzug - successfully breeding rabits
Azug - successfully breeding rabits
 
S016579 data-optimization-spectrum-control-brazil-v2
S016579 data-optimization-spectrum-control-brazil-v2S016579 data-optimization-spectrum-control-brazil-v2
S016579 data-optimization-spectrum-control-brazil-v2
 
Refactoring Into Microservices 2016-11-08
Refactoring Into Microservices 2016-11-08Refactoring Into Microservices 2016-11-08
Refactoring Into Microservices 2016-11-08
 
Creating a culture of cost management
Creating a culture of cost managementCreating a culture of cost management
Creating a culture of cost management
 
Impact 2013 2963 - IBM Business Process Manager Top Practices
Impact 2013 2963 - IBM Business Process Manager Top PracticesImpact 2013 2963 - IBM Business Process Manager Top Practices
Impact 2013 2963 - IBM Business Process Manager Top Practices
 

Plus de George Ang

Wrapper induction construct wrappers automatically to extract information f...
Wrapper induction   construct wrappers automatically to extract information f...Wrapper induction   construct wrappers automatically to extract information f...
Wrapper induction construct wrappers automatically to extract information f...George Ang
 
Opinion mining and summarization
Opinion mining and summarizationOpinion mining and summarization
Opinion mining and summarizationGeorge Ang
 
Huffman coding
Huffman codingHuffman coding
Huffman codingGeorge Ang
 
Do not crawl in the dust 
different ur ls similar text
Do not crawl in the dust 
different ur ls similar textDo not crawl in the dust 
different ur ls similar text
Do not crawl in the dust 
different ur ls similar textGeorge Ang
 
大规模数据处理的那些事儿
大规模数据处理的那些事儿大规模数据处理的那些事儿
大规模数据处理的那些事儿George Ang
 
腾讯大讲堂02 休闲游戏发展的文化趋势
腾讯大讲堂02 休闲游戏发展的文化趋势腾讯大讲堂02 休闲游戏发展的文化趋势
腾讯大讲堂02 休闲游戏发展的文化趋势George Ang
 
腾讯大讲堂03 qq邮箱成长历程
腾讯大讲堂03 qq邮箱成长历程腾讯大讲堂03 qq邮箱成长历程
腾讯大讲堂03 qq邮箱成长历程George Ang
 
腾讯大讲堂04 im qq
腾讯大讲堂04 im qq腾讯大讲堂04 im qq
腾讯大讲堂04 im qqGeorge Ang
 
腾讯大讲堂05 面向对象应对之道
腾讯大讲堂05 面向对象应对之道腾讯大讲堂05 面向对象应对之道
腾讯大讲堂05 面向对象应对之道George Ang
 
腾讯大讲堂06 qq邮箱性能优化
腾讯大讲堂06 qq邮箱性能优化腾讯大讲堂06 qq邮箱性能优化
腾讯大讲堂06 qq邮箱性能优化George Ang
 
腾讯大讲堂07 qq空间
腾讯大讲堂07 qq空间腾讯大讲堂07 qq空间
腾讯大讲堂07 qq空间George Ang
 
腾讯大讲堂08 可扩展web架构探讨
腾讯大讲堂08 可扩展web架构探讨腾讯大讲堂08 可扩展web架构探讨
腾讯大讲堂08 可扩展web架构探讨George Ang
 
腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站George Ang
 
腾讯大讲堂01 移动qq产品发展历程
腾讯大讲堂01 移动qq产品发展历程腾讯大讲堂01 移动qq产品发展历程
腾讯大讲堂01 移动qq产品发展历程George Ang
 
腾讯大讲堂10 customer engagement
腾讯大讲堂10 customer engagement腾讯大讲堂10 customer engagement
腾讯大讲堂10 customer engagementGeorge Ang
 
腾讯大讲堂11 拍拍ce工作经验分享
腾讯大讲堂11 拍拍ce工作经验分享腾讯大讲堂11 拍拍ce工作经验分享
腾讯大讲堂11 拍拍ce工作经验分享George Ang
 
腾讯大讲堂14 qq直播(qq live) 介绍
腾讯大讲堂14 qq直播(qq live) 介绍腾讯大讲堂14 qq直播(qq live) 介绍
腾讯大讲堂14 qq直播(qq live) 介绍George Ang
 
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍George Ang
 
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍George Ang
 
腾讯大讲堂16 产品经理工作心得分享
腾讯大讲堂16 产品经理工作心得分享腾讯大讲堂16 产品经理工作心得分享
腾讯大讲堂16 产品经理工作心得分享George Ang
 

Plus de George Ang (20)

Wrapper induction construct wrappers automatically to extract information f...
Wrapper induction   construct wrappers automatically to extract information f...Wrapper induction   construct wrappers automatically to extract information f...
Wrapper induction construct wrappers automatically to extract information f...
 
Opinion mining and summarization
Opinion mining and summarizationOpinion mining and summarization
Opinion mining and summarization
 
Huffman coding
Huffman codingHuffman coding
Huffman coding
 
Do not crawl in the dust 
different ur ls similar text
Do not crawl in the dust 
different ur ls similar textDo not crawl in the dust 
different ur ls similar text
Do not crawl in the dust 
different ur ls similar text
 
大规模数据处理的那些事儿
大规模数据处理的那些事儿大规模数据处理的那些事儿
大规模数据处理的那些事儿
 
腾讯大讲堂02 休闲游戏发展的文化趋势
腾讯大讲堂02 休闲游戏发展的文化趋势腾讯大讲堂02 休闲游戏发展的文化趋势
腾讯大讲堂02 休闲游戏发展的文化趋势
 
腾讯大讲堂03 qq邮箱成长历程
腾讯大讲堂03 qq邮箱成长历程腾讯大讲堂03 qq邮箱成长历程
腾讯大讲堂03 qq邮箱成长历程
 
腾讯大讲堂04 im qq
腾讯大讲堂04 im qq腾讯大讲堂04 im qq
腾讯大讲堂04 im qq
 
腾讯大讲堂05 面向对象应对之道
腾讯大讲堂05 面向对象应对之道腾讯大讲堂05 面向对象应对之道
腾讯大讲堂05 面向对象应对之道
 
腾讯大讲堂06 qq邮箱性能优化
腾讯大讲堂06 qq邮箱性能优化腾讯大讲堂06 qq邮箱性能优化
腾讯大讲堂06 qq邮箱性能优化
 
腾讯大讲堂07 qq空间
腾讯大讲堂07 qq空间腾讯大讲堂07 qq空间
腾讯大讲堂07 qq空间
 
腾讯大讲堂08 可扩展web架构探讨
腾讯大讲堂08 可扩展web架构探讨腾讯大讲堂08 可扩展web架构探讨
腾讯大讲堂08 可扩展web架构探讨
 
腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站
 
腾讯大讲堂01 移动qq产品发展历程
腾讯大讲堂01 移动qq产品发展历程腾讯大讲堂01 移动qq产品发展历程
腾讯大讲堂01 移动qq产品发展历程
 
腾讯大讲堂10 customer engagement
腾讯大讲堂10 customer engagement腾讯大讲堂10 customer engagement
腾讯大讲堂10 customer engagement
 
腾讯大讲堂11 拍拍ce工作经验分享
腾讯大讲堂11 拍拍ce工作经验分享腾讯大讲堂11 拍拍ce工作经验分享
腾讯大讲堂11 拍拍ce工作经验分享
 
腾讯大讲堂14 qq直播(qq live) 介绍
腾讯大讲堂14 qq直播(qq live) 介绍腾讯大讲堂14 qq直播(qq live) 介绍
腾讯大讲堂14 qq直播(qq live) 介绍
 
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
 
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
腾讯大讲堂15 市场研究及数据分析理念及方法概要介绍
 
腾讯大讲堂16 产品经理工作心得分享
腾讯大讲堂16 产品经理工作心得分享腾讯大讲堂16 产品经理工作心得分享
腾讯大讲堂16 产品经理工作心得分享
 

Dernier

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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
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
 
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
 
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
 
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
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
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
 

Dernier (20)

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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
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
 
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
 
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!
 
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)
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
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
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"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...
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
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
 

E Bay Best Practices For Scaling Websites

  • 1. Best Practices for Scaling Websites Randy Shoup eBay Distinguished Architect QCon Asia 2009
  • 2. Challenges at Internet Scale • eBay manages … – 86.3 million active users worldwide – 120 million items for sale in 50,000 categories – Over 2 billion page views per day – eBay users trade over $2000 in goods every second -- $60 billion per year – eBay site stores over 2 PB of data – eBay processes 50 TB of new, incremental data per day – eBay Data Warehouse analyzes 50 PB per day • In a dynamic environment – 300+ features per quarter – We roll 100,000+ lines of code every two weeks • In 39 countries, in 8 languages, 24x7x365 >48 Billion SQL executions/day! © 2009 eBay Inc.
  • 3. Architectural Forces at Internet Scale • Scalability – Resource usage should increase linearly (or better!) with load – Design for 10x growth in data, traffic, users, etc. • Availability – Resilience to failure (MTBF) – Rapid recoverability from failure (MTTR) – Graceful degradation • Latency – User experience latency – Data latency • Manageability – Simplicity – Maintainability – Diagnostics • Cost – Development effort and complexity – Operational cost (TCO) © 2009 eBay Inc.
  • 4. Best Practices for Scaling 1. Partition Everything 2. Asynchrony Everywhere 3. Automate Everything 4. Remember Everything Fails 5. Embrace Inconsistency © 2009 eBay Inc.
  • 5. Best Practice 1: Partition Everything • Split every problem into manageable chunks – By data, load, and/or usage pattern – “If you can’t split it, you can’t scale it” • Motivations – Scalability: can scale horizontally and independently – Availability: can isolate failures – Manageability: can decouple different segments and functional areas – Cost: can use less expensive hardware © 2009 eBay Inc.
  • 6. Best Practice 1: Partition Everything Pattern: Functional Segmentation – Segment processing into pools, services, and stages – Segment data along usage boundaries Pattern: Horizontal Split – Load-balance processing • Within a pool, all servers are created equal – Split (or “shard”) data along primary access path • Partition by range, modulo of a key, lookup, etc. Corollary: No Session State – User session flow moves through multiple application pools – Absolutely no session state in application tier © 2009 eBay Inc.
  • 7. Best Practice 2: Asynchrony Everywhere • Prefer Asynchronous Processing – Move as much processing as possible to asynchronous flows – Where possible, integrate disparate components asynchronously • Motivations – Scalability: can scale components independently – Availability • Can decouple availability state • Can retry operations – Latency • Can significantly improve user experience latency at cost of data/execution latency • Can allocate more time to processing than user would tolerate – Cost: can spread peak load over time © 2009 eBay Inc.
  • 8. Best Practice 2: Asynchrony Everywhere Pattern: Event Queue – Primary use-case produces event • Create event (ITEM.NEW, ITEM.SOLD) transactionally with primary insert/update – Consumers subscribe to event • At least once delivery • No guaranteed order • Idempotency and readback Pattern: Message Multicast – Search Feeder publishes item updates • Reads item updates from primary database • Publishes sequenced updates via SRM-inspired protocol – Nodes listen to assigned subset of messages • Update in-memory index in real time • Request recovery (NAK) when messages are missed © 2009 eBay Inc.
  • 9. Best Practice 3: Automate Everything • Prefer Adaptive / Automated Systems to Manual Systems • Motivations – Scalability • Can scale with machines, not humans – Availability / Latency • Can adapt to changing environment more rapidly – Cost • Machines are far less expensive than humans • Can learn / improve / adjust over time without manual effort © 2009 eBay Inc.
  • 10. Best Practice 3: Automate Everything Pattern: Adaptive Configuration – Define SLA for a given logical consumer • E.g., 99% of events processed in 15 seconds – Dynamically adjust config to meet defined SLA Pattern: Machine Learning – Dynamically adapt search experience • Determine best inventory and assemble optimal page for that user and context – Feedback loop enables system to learn and improve over time • Collect user behavior • Aggregate and analyze offline • Deploy updated metadata • Decide and serve appropriate experience – Perturbation and dampening © 2009 eBay Inc.
  • 11. Best Practice 4: Remember Everything Fails • Build all systems to be tolerant of failure – Assume every operation will fail and every resource will be unavailable – Detect failure as rapidly as possible – Recover from failure as rapidly as possible – Do as much as possible during failure • Motivation – Availability © 2009 eBay Inc.
  • 12. Best Practice 4: Remember Everything Fails Pattern: Failure Detection – Servers log all requests • Log all application activity, database and service calls on multicast message bus • Over 2TB of log messages per day – Listeners automate failure detection and notification Pattern: Rollback – Absolutely no changes to the site which cannot be undone (!) – Every feature has on / off state driven by central configuration • Feature can be immediately turned off for operational or business reasons • Features can be deployed “wired-off” to unroll dependencies Pattern: Graceful Degradation – Application “marks down” an unavailable or distressed resource – Non-critical functionality is removed or ignored – Critical functionality is retried or deferred © 2009 eBay Inc.
  • 13. Best Practice 5: Embrace Inconsistency • Brewer’s CAP Theorem – Any shared-data system can have at most two of the following properties: • Consistency: All clients see the same data, even in the presence of updates • Availability: All clients will get a response, even in the presence of failures • Partition-tolerance: The system properties hold even when the network is partitioned – This trade-off is fundamental to all distributed systems © 2009 eBay Inc.
  • 14. Best Practice 5: Embrace Inconsistency Choose Appropriate Consistency Guarantees – To guarantee availability and partition-tolerance, we trade off immediate consistency – Most real-world systems (even financial systems!) do not require immediate consistency – Consistency is a spectrum – Prefer eventual consistency to immediate consistency Avoid Distributed Transactions – eBay does absolutely no distributed transactions – no two-phase commit – Minimize inconsistency through state machines and careful ordering of operations – Eventual consistency through asynchronous event or reconciliation batch © 2009 eBay Inc.
  • 15. Recap: Best Practices for Scaling 1. Partition Everything 2. Asynchrony Everywhere 3. Automate Everything 4. Remember Everything Fails 5. Embrace Inconsistency © 2009 eBay Inc.
  • 16. Questions? About the Presenter Randy Shoup has been the primary architect for eBay's search infrastructure since 2004. Prior to eBay, Randy was Chief Architect and Technical Fellow at Tumbleweed Communications, and has also held a variety of software development and architecture roles at Oracle and Informatica. rshoup@ebay.com © 2009 eBay Inc.