• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Delaying Gratification: Using queues to build efficient systems
 

Delaying Gratification: Using queues to build efficient systems

on

  • 240 views

 

Statistics

Views

Total Views
240
Views on SlideShare
240
Embed Views
0

Actions

Likes
0
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Delaying Gratification: Using queues to build efficient systems Delaying Gratification: Using queues to build efficient systems Presentation Transcript

    • Delaying Gratification Using queues to build efficient systems
    • Copyright © 2014 Magento, Inc. All Rights Reserved. Magento®, eBay Enterprise™ and their respective logos are trademarks, service marks, registered trademarks, or registered service marks of eBay, Inc. or its subsidiaries. Other trademarks or service marks contained in this presentation are the property of the respective companies with which they are associated. This presentation is for informational and discussion purposes only and should not be construed as a commitment of Magento, Inc. or GSI Commerce, Inc. d/b/a eBay Enterprise (“eBay Enterprise”) or of any of their subsidiaries or affiliates. While we attempt to ensure the accuracy, completeness and adequacy of this presentation, neither Magento, Inc., eBay Enterprise nor any of their subsidiaries or affiliates are responsible for any errors or will be liable for the use of, or reliance upon, this presentation or any of the information contained in it. Unauthorized use, disclosure or dissemination of this information is expressly prohibited.
    • Tom Lodge Senior Magento eCommerce Architect Magento ECG tlodge@ebay.com
    • Kevin Schroeder Technical Manager of Education and Consulting Magento ECG, MagentoU keschroeder@ebay.com @kpschrade
    • Business Case1
    • Welcome to BillyBobBBQs.com • BillyBobBBQs.com • Sell BBQs • Sell a LOT of BBQs
    • The Board Expects • Optimal Customer Experience • Maximise Sales • Minimise Costs
    • Simple stuff • Payment Gateway • ERP Integration • Third Party Systems
    • Marketing promotes success • BillyBobBBQs.com have a great PR team • PR aren’t always able to predict success • Chairman on Good Morning America
    • Success can be a problem • Site designed for a volume of traffic • Chairman just invited USA to visit • Site needs to scale • Max Sales, Min Cost
    • OK so what next… • Maintain Customer Experience • Maximise Sales • Minimise Costs • Handle Spikes
    • Thinking About The Problem2
    • How we (like to) think about scaling 0 50 100 150 200 250 300 350 400 0 1 2 3 4 5 6 7 1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97 Capacity Traffic
    • Billy Bob’s scaling experience 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51
    • Solution: Cloud Server Server Timeline
    • Two Problems
    • 1: Clouds still like predictability Throughput Capacity
    • 2: We’ve only scaled web nodes Server Server Server Server Server Server Server Database
    • What does Billy Bob need? A system that can temporarily manage peaks that are beyond the synchronous capacity of the system while retaining functionality and responsiveness In other words we are talking about scalability not performance
    • Defining A Solution3
    • Requirements • MUST handle spikes without interfering with the customer • MUST mitigate spikes without overwhelming the infrastructure • MUST be able to use resources efficiently
    • Billy Bob needs a system like this Throughput Capacity    
    • Options Batching Queuing
    • Difference between batch and queue Batch Queue
    • Difference between batch and queue Batch Queue
    • Difference between batch and queue Batch Queue
    • The Effect on Infrastructure Batch Queue 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% wa id sy us 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% wa id sy us
    • Batching QueuingQu
    • Implementing A Solution4
    • Front End Node Worker Queue Basic Work Flow
    • MUST handle spikes without interfering with the customer MUST be able to use resources efficiently MUST mitigate spikes without overwhelming the infrastructure
    • Uni-Directional Job Executed On The Frontend Executed On The BackendUnit Testing Entry Point
    • Eg. 1 – Uni-Directional5
    • Bi-Directional Job Executed In The Future
    • Bi-Directional Result Tickets Get a result ticket Job is returned when it has finished executing
    • Eg.2 – Bi-Directional Blocking/Non-Blocking 6
    • Integration with Magento7
    • How can Billy Bob use this? 1. Initiate jobs at controller_action_predispatch for consumption during block rendering 2. Execute multiple concurrent data requests from web services 3. Initiate data retrieval for retrieval in subsequent Ajax requests 4. Implement an ordering mechanism that throttles order processing (beware of PCI issues here, obviously) 5. Update ERP systems immediately with no client interruption 6. Ideas?
    • https://github.com/kschroeder/Magento-Worker-Queue_POC
    • Questions9
    • Thanks Tom Lodge Senior Magento eCommerce Architect Magento ECG tlodge@ebay.com Kevin Schroeder Technical Manager of Education and Consulting Magento ECG, MagentoU keschroeder@ebay.com @kpschrade