Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Don't fear the Walking Dead @ IPC 2016

477 views

Published on

Revised talk held by Sebastian Thoß and Sebastian Heuer at International PHP Conference 2016 in Munich.

"Legacy software can be like a zombie: it somehow still works, but nobody would consider it alive and well anymore and the thought of having to touch it makes you want to run away. So what can you do to get rid of it? We are currently replacing our monolithic e-commerce platform with a shiny new custom-tailored solution and want to show you what we do and what we have already learned."

Published in: Software
  • Be the first to comment

Don't fear the Walking Dead @ IPC 2016

  1. 1. HOW WE GET RID OF OUR MONOLITH DON’T
  2. 2. How we started • built on top of a standard e-commerce platform • a lot of custom code to support a wide combination of product options Feature X Feature Y Feature Z Core Code Customization
  3. 3. The challenges of a growing business • serious performance issues • own developers don’t feel comfortable with the code • adding individual features is too complex • upgrading is hard
  4. 4. Finding a way out
  5. 5. You don’t have to replace everything at once!
  6. 6. What part of the software causes the highest amount of pain? • category pages • product detail pages
  7. 7. Planning
  8. 8. Traditional Architecture PHP Application Session Storage RDBMS Webserver PIM / ERP
  9. 9. Incoming Request PHP Application Session Storage RDBMS Webserver PIM / ERP
  10. 10. Caching PHP Application Session Storage RDBMS Webserver PIM / ERP Cache
  11. 11. Caching PHP Application Session Storage RDBMS Webserver PIM / ERP Cache
  12. 12. Our Initial Setup Legacy System Session Storage RDBMS Webserver PIM / ERP Cache
  13. 13. Idea Legacy System Session Storage RDBMS Webserver New Software
  14. 14. FURY Frontend Key-Value Store getCategoryPage('hochzeit'); "<html><head>…</head><body>…</body></html>"
  15. 15. FURY Frontend Key-Value Store ["SBU06HE","TEOD3HE","ANW04HD"] Search search("{'category':'hochzeit', 'filters':{}}"); getTiles(["SBU06HE","TEOD3HE","ANW04HD"]); ["<div class="category-item">…</div>", …]
  16. 16. CQRS-based Architecture PHP Frontend Session Storage Webserver Key/Value Store PHP Backend PIM / ERPSearch Engine
  17. 17. Incoming Request PHP Frontend Session Storage Webserver Key/Value Store PHP Backend PIM / ERPSearch Engine
  18. 18. New Data PHP Frontend Session Storage Webserver Key/Value Store PHP Backend PIM / ERPSearch Engine
  19. 19. Webserver Key-Value Store Search FURY Frontend FURY Backend FURY Components
  20. 20. Webserver Key-Value Store Search FURY Frontend FURY Backend Legacy RDBMS Legacy System Session Storage Collect & Export K-V Store
  21. 21. Webserver Key-Value Store Search FURY Frontend FURY Backend Legacy RDBMS Legacy System FURY Requests 200OK Session Storage K-V Store
  22. 22. Webserver Key-Value Store Search FURY Frontend FURY Backend Legacy RDBMS Legacy System Requests to Legacy System 404NOTFOUND Session Storage K-V Store
  23. 23. Webserver Key-Value Store Search FURY Frontend FURY Backend Legacy RDBMS Legacy System Requests to Legacy System 404NOTFOUND 200 OK Session Storage K-V Store
  24. 24. Learnings • we have full responsibility now • no framework needed • no relational database needed • accessing the legacy session storage was too slow • solved by adding a read slave for FURY
  25. 25. Goods and Bads • three months of development until first launch • fully object-oriented • easy refactoring thanks to 100% code coverage • not enough automated acceptance tests • dependencies to legacy software (database changes, API calls)
  26. 26. A/B Deployment
  27. 27. Webserver (Router) Webserver FURY Frontend Server A K/V StoreSearch FURY Backend Webserver FURY Frontend Server B K/V StoreSearch FURY Backend
  28. 28. Webserver (Router) Webserver FURY Frontend Server A K/V StoreSearch FURY Backend Webserver FURY Frontend Server B K/V StoreSearch FURY Backend active = A
  29. 29. Webserver (Router) Webserver FURY Frontend Server A K/V StoreSearch FURY Backend Webserver FURY Frontend Server B K/V StoreSearch FURY Backend active = B
  30. 30. Webserver (Router) Webserver FURY Frontend Server A K/V StoreSearch FURY Backend active = B
  31. 31. RDBMS Read Slave Webserver FURY Frontend Server A K/V StoreSearch FURY Backend Webserver (Router) Build Server Deploy Code active = B
  32. 32. RDBMS Read Slave Webserver FURY Frontend Server A K/V StoreSearch FURY Backend Webserver (Router) Build Server Deploy Code Collect & Export active = B
  33. 33. RDBMS Read Slave Webserver FURY Frontend Server A K/V StoreSearch FURY Backend Webserver (Router) Build Server Deploy Code Collect & Export Smoke Tests active = B
  34. 34. Smoke Tests<?php namespace KartenmachereiIPC2016; use PHPUnit_Framework_TestCase; class SmokeTest extends PHPUnit_Framework_TestCase { /** * @dataProvider furyUrlProvider * * @param Url $url */ public function testFuryUrl(Url $url) { $result = $this->sendGetRequest($url); $this->assertSame(200, $result->getStatusCode()); $this->assertNotEmpty($result->getBody()); $this->assertLessThanOrEqual(100, $result->getTimeToFirstByteInMilliseconds()); }
  35. 35. RDBMS Read Slave Webserver FURY Frontend Server A K/V StoreSearch FURY Backend Webserver (Router) Build Server Deploy Code Collect & Export Smoke Tests active = B
  36. 36. RDBMS Read Slave Webserver FURY Frontend Server A K/V StoreSearch FURY Backend Webserver (Router) Build Server Deploy Code Collect & Export Smoke Tests active = B
  37. 37. RDBMS Read Slave Webserver FURY Frontend Server A K/V StoreSearch FURY Backend Webserver (Router) Build Server Deploy Code Collect & Export Smoke Tests Switch to A active = A
  38. 38. RDBMS Read Slave Webserver FURY Frontend Server A K/V StoreSearch FURY Backend active = B Webserver (Router) Build Server Deploy Code Collect & Export
  39. 39. What's next?
  40. 40. Client /product
  41. 41. Client /checkout/cart
  42. 42. Client /checkout/basket Basket Service
  43. 43. Client /checkout/basket Basket
 Service
  44. 44. Next steps • open-source our CQRS RESTful Framework • replace the next parts of the legacy system with new, self-contained components / services
  45. 45. Next steps • open-source our CQRS RESTful Framework • improve our deployment process • replace the next parts of the legacy system with new, self-contained components / services
  46. 46. Next steps • open-source our CQRS RESTful Framework • improve our deployment process • replace the next parts of the legacy system with new, self-contained components / services
  47. 47. "one hundred fifty-seven quinvigintillion, seven hundred eighty-six quattuorvigintillion, six hundred fifty-seven trevigintillion, seven hundred forty-seven duovigintillion, three hundred forty unvigintillion, one hundred eighty-six vigintillion, (…) nine hundred forty-five quintillion, eight hundred twenty-eight quadrillion, two hundred seventy trillion, eighty billion, …"
  48. 48. Q&A https://www.facebook.com/kartenmacherei/ jobs@kartenmacherei.de http://www.kartenmacherei.de/recruiting https://tech.kartenmacherei.de/ @techdotkam

×