$30 off During Our Annual Pro Sale. View Details »

Strangler application patterns and antipatterns

Strangler application patterns and antipatterns

A few observations about what makes success more likely in application rewrite effort

Matteo Vaccari

April 11, 2016

More Decks by Matteo Vaccari

Other Decks in Technology



  2. Get a whiteboard, put on the colored stickies, and try

    not to be a pain in the arse. #agile #inanutshell
  3. A company and its software

  4. None
  5. Legacy code == code that is difficult to change

  6. The core domain of a profitable company is always complex

  7. Refactor or rewrite? What to do with legacy code?

  8. Why do we fear the big rewrite?

  9. http://www.bonkersworld.net/building-software/

  10. Things going against the big rewrite • Same people and

    same methods: they will get the same results • The old software contains knowledge and details that we’re not aware of • While we are busy rewriting the old features, competitors are busy implementing new ones • Why is there always time to do things over, but there is never time to do things right?
  11. A tale of two companies • There once were two

    competing companies, with equal market share • One company rewrote their product… • … and many customers migrated to the other! • The company who kept the old codebase now has twice the market share
  12. A digression on software design

  13. A non-obvious fact

  14. This is more complex…

  15. …than these

  16. Doing it wrong…

  17. What are the factors that make the split work well?

  18. Simplicity is achieved when… • Each box is understandable in

    isolation • Each box does only one thing • Each box represents a single concept • Each box is cohesive
  19. How to connect A & B

  20. Simplicity is achieved when… • Things are loosely coupled •

    Or, rather… • … they are coupled appropriately
  21. Design is fractal!

  22. And, similarly…

  23. Or worse!

  24. How to connect services?

  25. Domain Events to the rescue!

  26. A Domain Event

  27. How to connect services? REST apis RSS-like event queue Messaging

  28. So how do we deal with legacy code?

  29. None
  30. Patterns for incremental improvement 1. Pay down your technical debt

    2. Bubble context 3. Strangler application
  31. Strangler application Database nuovo App Nuova Database legacy App Legacy

    Batch Sync Utenti Apache Perl filter Utenti migrati Utenti non migrati Router Old and new apps Update mechanism
  32. A Strangler application is composed of: • A router •

    The old application • The new application(s) • An update mechanism
  33. Another example

  34. Strangler app antipatterns

  35. The router is inside the legacy app

  36. The new app is aware of the old one

  37. For best results, the new app and the old should

    not be aware of each other! • A router • The old application • The new application(s) • An update mechanism
  38. Conclusions?

  39. None
  40. twitter.com/xpmatteo thoughtworks.com THANK YOU WE ARE HIRING! YES, IN ITALY!