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.

28764a44623db0ef2d95b914054c916f?s=128

Robin Müller

April 28, 2017
Tweet

Transcript

  1. @_RobM Changing tires at 100mph

  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
  3. @_RobM 3 Our vision

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

  5. Our current (Magento) store is legacy

  6. @_RobM 6

  7. @_RobM We use caching to scale 7 • Different cache

    types • MySQL query cache • Opcode cache • Application cache • Frontend cache • Browser cache
  8. @_RobM The hard parts about varnish 8 • Cache invalidation

    • Hole punching using AJAX or ESI Cached Uncached
  9. Varnish makes our life harder A/B Testing Personalization Real time

    updates
  10. How can we get rid of caching?

  11. Easy. Make the application lighter!

  12. Let’s build a new shop frontend!

  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
  14. Lesara Open Source

  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
  16. @_RobM 17 The new architecture

  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
  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
  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
  20. @_RobM 21

  21. @_RobM 22

  22. @_RobM Indexing data 23 Documents (in all languages) Products Categories

    Settings / Configuration Translations Other content pages
  23. @_RobM How to prevent duplication 24 Header and footer are

    present in all pages. Use Server side includes
  24. @_RobM The migration plan 25 High traffic to low traffic

    Header & Footer via SSI Home Categories Search results Product Detail pages REST-API …
  25. @_RobM How fast is it? (Home page) 26

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

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

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

  29. Questions?