Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Changing Tires at 100mph

Changing Tires at 100mph

The massive growth of Lesara in the last three years lead to a high traffic level of the online shop.
With several million page views, API calls and events every day, it is hard to migrate to new, more modern systems. The migration can lead to bugs, a drop in SEO visibility and unavailability of the whole service, which is feared by marketers, engineers and executives.

The talk walks you through the reasons for a new stack, which technologies we selected and what the new architecture looks like.

Robin Müller

April 28, 2017
Tweet

More Decks by Robin Müller

Other Decks in Technology

Transcript

  1. @_RobM
    Changing tires at 100mph

    View full-size slide

  2. @_RobM 2
    Gaming
    Legal Tech
    E-Commerce
    Robin Müller
    CTO & Co-Founder at Lesara
    What I do at Lesara
    What I did before
    Scaling
    Tracking
    Tech Strategy
    BS Computer Science
    Security Product

    View full-size slide

  3. @_RobM 3
    Our vision

    View full-size slide

  4. @_RobM
    Baseline
    20x
    Peaks up to 120x

    View full-size slide

  5. Our current (Magento) store is legacy

    View full-size slide

  6. @_RobM
    We use caching to scale
    7
    • Different cache types
    • MySQL query cache
    • Opcode cache
    • Application cache
    • Frontend cache
    • Browser cache

    View full-size slide

  7. @_RobM
    The hard parts about varnish
    8
    • Cache invalidation
    • Hole punching using AJAX or ESI
    Cached
    Uncached

    View full-size slide

  8. Varnish makes our life harder
    A/B Testing Personalization
    Real time updates

    View full-size slide

  9. How can we get rid of caching?

    View full-size slide

  10. Easy. Make the application lighter!

    View full-size slide

  11. Let’s build a new shop frontend!

    View full-size slide

  12. @_RobM
    What are we looking for?
    13
    Product
    Loading times < 100ms
    A/B Testing in the core
    Live updates
    Completely personalizable
    Step-by-step migration
    Developers
    PHP 7
    Modern framework
    No more FPC
    Community
    Tech
    Fast & light
    Easy to update
    Open Source
    New CDN
    Fully tested

    View full-size slide

  13. Lesara Open Source

    View full-size slide

  14. @_RobM 15
    Based on
    PHP 7
    Symfony 3
    elasticsearch 5
    Redis 3
    Bundles
    Elasticsearch bundle
    Filter manager bundle
    Settings bundle
    Router bundle
    Translation bundle

    Built for
    Massive scale
    Step-by-step migration
    Frequent data updates
    Rendering in 100ms

    View full-size slide

  15. @_RobM 17
    The new architecture

    View full-size slide

  16. @_RobM
    The router can make your application smart
    18
    Requirements
    Response time(<5ms)
    Scalability
    Opportunities
    Save a second lookup via header
    Circuit-breaker-pattern
    A/B Testing
    Staged Feature Rollouts

    View full-size slide

  17. @_RobM
    Router implementations
    19
    PHP + fastcgi
    Silex
    > 2000 tr/s
    > 25k – 30k tr/s (fastcgi)
    Stable implementation
    LUA-script w/ OpenResty
    ES 5 only hacked
    10k – 15k tr/s
    Go
    Seg-faults under load
    > 30k tr/s

    View full-size slide

  18. @_RobM
    Circuit breaker pattern
    Like a real circuit breaker in a fuse box in your home
    Have a pause when a backend service fails
    MONITOR IT!
    20

    View full-size slide

  19. @_RobM
    Indexing data
    23
    Documents (in all languages)
    Products
    Categories
    Settings / Configuration
    Translations
    Other content pages

    View full-size slide

  20. @_RobM
    How to prevent duplication
    24
    Header and footer are
    present in all pages.
    Use Server side
    includes

    View full-size slide

  21. @_RobM
    The migration plan
    25
    High traffic to low traffic
    Header & Footer via SSI
    Home
    Categories
    Search results
    Product Detail pages
    REST-API

    View full-size slide

  22. @_RobM
    How fast is it? (Home page)
    26

    View full-size slide

  23. @_RobM
    How does it scale? (Home page)
    27

    View full-size slide

  24. @_RobM
    How fast is it? (Categories)
    28

    View full-size slide

  25. @_RobM
    How does it scale? (Categories)
    29

    View full-size slide