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 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 Slide

  3. @_RobM 3
    Our vision

    View Slide

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

    View Slide

  5. Our current (Magento) store is legacy

    View Slide

  6. @_RobM 6

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  10. How can we get rid of caching?

    View Slide

  11. Easy. Make the application lighter!

    View Slide

  12. Let’s build a new shop frontend!

    View Slide

  13. @_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 Slide

  14. Lesara Open Source

    View Slide

  15. @_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 Slide

  16. @_RobM 17
    The new architecture

    View Slide

  17. @_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 Slide

  18. @_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 Slide

  19. @_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 Slide

  20. @_RobM 21

    View Slide

  21. @_RobM 22

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  29. Questions?

    View Slide