For the past 3 years, ASOS has been on a journey of moving its monolithic architecture to Microservices - and what has been driving this change is not just the buzzword: as with any monolith, the spiraling cost of change stifles the business and innovation. And in this market, advancing your competitive edge by constant improvement is a big factor in the overall success of your business.
Probably not many know that ASOS website drives more traffic (and way more bandwidth) than the showcase Stackoverflow. Some of the services are built to serve up to 10K RPS (request/second). And the services are spread around the globe currently on more than 4 Azure DCs. And on the top, we have pretty thick data pipelines moving many GBs of data to enable traditional BI - as well as the trendy Machine Learning algorithms powering recommendations and personalisation.
This talk will be a brief intro to the overall view of what +20 2-pizza teams are doing and in specific, goes into some of the details of ML-enabled recommendations platform. Underneath the success of the transition, has been a Logging/Monitoring/Alerting system (Elasticsearch+ConverorBelt+Kibana) to empower platform teams to ensure health of the system and keeping Mean-Time-to-Recovery low.
As with any such talk, there will be a section on lessons learned...
3. @aliostad
/// mini-agenda
> Microservice: aspects you do not hear enough about
> Observability
> Patterns for building microservices
> ASOS Recommendations as an example of Microservices
> ASOS: Company and the tech
6. /// ASOS in numbers
2 0 1 6 T u r n O v e r → £1.5 bln
A c t i v e C u s t o m e r s → 12 M
E m p l o y e e s → 2500
U n i q u e V i s i t s / m o → 123 M
P a g e V i e w s / d a y → 95 M
V i r t u a l S t o r e s → 9
A z u r e D C s → 5
18. @aliostad
/// why microservices
> Scaling people not the solution
> Decentralising decision centres => Agility
> Frequent deployment => Agility
> Reduced complexity of each ms (Divide/Conquere) => Agility
> Cost of mistakes and bad decisions smaller ...
> Overall complexity is smaller
19. @aliostad
/// microservices vs soa
SOA Microservices
Main Goal Architectual Decoupling Business Agility
Set out to solve Architectural Coupling
Scaling People,
Frequent Deployment
Audience Mainly Architecture Business (Everyone)
Law Conway’s Reverse Conway’s
Impact on Structure of
Organisation
Minimal Huge
Service Cardinality Usually up to a dozen >40 (Commonly >100)
When to do Always teams > ~5**
** Debateable. There are articles and discussions on this very topic
20. @aliostad
/// microservice challenges
> Very difficult to build a complete mental picture of solution
> When things go wrong, need to know where before why
> Potentially increased latency
> Performance outliers intractable to solve
> A complete mind-shift requiring a new operating model
25. @aliostad
/// some guidelines
1
2
3
4
Break-up your business to domains and subdomains
Plan for your system’s observability
Define a set of key constraints on microservices
Start building by chiselling or strangling parts of monolith
26. @aliostad
/// some guidelines
1
2
3
4
Break-up your business to domains and subdomains
Plan for your system’s observability
Define a set of key constraints between microservices
Start building by chiselling or strangling parts of monolith
30. @aliostad
3x client
2x kibana
20x data (hot)
traffic
traffic
10x data (warm)
/// our setup
3x master
ARM
Template
Desire State
Configuration
31. @aliostad
/// some guidelines
1
2
3
4
Break-up your business to domains and subdomains
Plan for your system’s observability
Define a set of key constraints between microservices
Start building by chiselling or strangling parts of monolith
32. @aliostad
/// some of asos constraints
a
b
c
d
All commands across MS are synchronous REST calls
Microservices do send ansychronous events
OpenId connect for Identity and Azure AD for x-MS calls
All REST calls send a set of standard headers such as
correlation-id, client version, etc
33. @aliostad
/// types of microservices
Microservice
Data Store
Functional
API
Microservice
Compositional
(sometimes BEFFE, also Gateway)
APIservice
service
34. @aliostad
/// exposing data
> All data needs to be exposed only via API
> For data-intensive operations or when the origin of the
request is a system favour data integration
> On exceptional performance-related cases, giving read-
only access to a secondary data source (e.g. soft store) is OK
> For analytics purpose, all data shared via Data Lake
35. @aliostad
/// some guidelines
1
2
3
4
Break-up your business to domains and subdomains
Plan for your system’s observability
Define a set of key constraints between microservices
Start building by chiselling or strangling parts of monolith
41. @aliostad
/// Wrap-up
> If you have more than 4 teams, consider Microservices
> Response outliers the most intractable problems in Microservices
> “Nevermind the Microservices” if you don’t have observability
> Define a set of key constraints in/between your microservices
> Chisel and strangulate the monolith
44. @aliostad
Thomas Wood: Daisy Picture
Thomas Au: Thermometer Picture
Torbakhopper: Cables Picture
Dam Picture - Japan
Hsiung: Lights Picture
Health Endpoint in API Design