![Page 1: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/1.jpg)
Refactor your Software Architecture
![Page 2: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/2.jpg)
Who am I?Julien Lavigne du CadetDev lead at Criteo
http://fr.linkedin.com/in/julienlavigneducadet/@julienlavigne
![Page 3: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/3.jpg)
How to structure yourenterprise applications
![Page 4: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/4.jpg)
… a business problem!
We often start with…
![Page 5: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/5.jpg)
That we try to solve with…
![Page 6: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/6.jpg)
That we try to solve with…
Languages
Frameworks
Persistencetechnologies
![Page 7: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/7.jpg)
...and a 3 tiers architecture
Business
Data
UI
![Page 8: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/8.jpg)
…and a 3 tiers architecture
Asp.net MVC
SQL Server
Angular
![Page 9: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/9.jpg)
…and a 3 tiers architecture
WCF
SQL Server
WPF
![Page 10: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/10.jpg)
...and a 3 tiers architecture
Play
Oracle
Ember
![Page 11: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/11.jpg)
With some layers…
DTOApplication LogicBusiness LogicData Access
Database
UI
![Page 12: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/12.jpg)
With some layers…
Application LogicBusiness LogicData Access
Database
UI
![Page 13: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/13.jpg)
And it grows…
![Page 14: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/14.jpg)
And it grows…
… and it gets slow!
![Page 15: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/15.jpg)
And it gets unmaintanable!
![Page 16: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/16.jpg)
Why?Why?
![Page 17: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/17.jpg)
Releases are all or nothing*
![Page 18: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/18.jpg)
Releases are all or nothing**Some people will tell you that’s why we have stored procedures... Don’t trust them :p.
![Page 19: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/19.jpg)
Refactorings are expansiveMigrating to new frameworks requires rewriting a whole layer
![Page 20: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/20.jpg)
One size doesn’t fit allHard to have custom solutions for a vertical
![Page 21: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/21.jpg)
What can we do?
![Page 22: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/22.jpg)
We learned to split in the wrong direction
![Page 23: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/23.jpg)
Split the system into small components…
![Page 24: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/24.jpg)
… releasable independently from each other
![Page 25: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/25.jpg)
Architecture:interfaces and interactions between our components
![Page 26: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/26.jpg)
Business
Database
UI
Or how to go from…
![Page 27: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/27.jpg)
UI
To…
![Page 28: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/28.jpg)
UI
Or more realistically to…
Business
Database
![Page 29: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/29.jpg)
UI
Or even that…
Business
Database
Job Scheduler
![Page 30: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/30.jpg)
How do we proceed?
![Page 31: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/31.jpg)
Start small
![Page 32: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/32.jpg)
Identify one featurethat has few dependencies… Example: sending emails
![Page 33: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/33.jpg)
Define the APIinterface & communication protocol
![Page 34: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/34.jpg)
Choose an architectural style
RESTWEB SERVICESERVICE BUS…
![Page 35: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/35.jpg)
What is the offered service?
![Page 36: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/36.jpg)
What is the offered service?
InputsFROMTOTITLEBODY
![Page 37: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/37.jpg)
What is the offered service?
InputsFROMTOTITLEBODY
OutputsACK / ERROR CODECALLBACKS / EVENTS
![Page 38: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/38.jpg)
UI
Focus on
![Page 39: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/39.jpg)
Implement and deploydeployment should be independent of everything else!
![Page 40: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/40.jpg)
Replace usages everywhere
![Page 41: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/41.jpg)
Go back to step one and… start again**a lot… :-)
![Page 42: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/42.jpg)
The next steps
![Page 43: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/43.jpg)
Start writing all new code in components
![Page 44: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/44.jpg)
Encapsulate legacy codeIt’s fine to have some uglyness in a component as long as the interface is clean!
![Page 45: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/45.jpg)
Define clear boundaries
![Page 46: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/46.jpg)
Make everything accessible through an APIFrom business features to technical features
![Page 47: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/47.jpg)
What did we achieve?
![Page 48: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/48.jpg)
Reuse and centralisation
![Page 49: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/49.jpg)
Independent deployments…and rollbacks!Shorter release cycles, less risks, happy users!
![Page 50: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/50.jpg)
Independent component designsKeep It Simple, Stupid
![Page 51: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/51.jpg)
Independent component designsExperiment!
![Page 52: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/52.jpg)
Replaceable components
![Page 53: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/53.jpg)
Easier testingTest the component & the interactions with the component
![Page 54: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/54.jpg)
In conclusion…
![Page 55: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/55.jpg)
Software architecture is aboutdefining high level principles…
![Page 56: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/56.jpg)
To shorten release cycles…
![Page 57: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/57.jpg)
And keep the system maintenable
![Page 58: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/58.jpg)
My suggestion
![Page 59: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/59.jpg)
build small components…
![Page 60: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/60.jpg)
That communicate throuh defined interfaces
![Page 61: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/61.jpg)
Give it a try!
![Page 62: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/62.jpg)
Thank you!
![Page 63: Ncrafts.io - Refactor your software architecture](https://reader034.vdocument.in/reader034/viewer/2022052523/55621864d8b42af2128b547e/html5/thumbnails/63.jpg)
We’re hiring!http://www.criteo.com/en/jobs