microservice architecture at asos - cloudbrew/azug.be
TRANSCRIPT
© 2016 ||| ASOS Plc@aliostad @dav3green
ASOS
Established at 2000
Global Fashion destination for “20-something”.
Hires +2500 staff & +250 in tech (700)
Grown average of 35% YoY
39th biggest global online retailer
© 2016 ||| ASOS Plc@aliostad @dav3green
In Numbers
A c t i v e C u s t o m e r s → 12 M
N e w P r o d u c t s / w k → 4 k
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
P l a t f o r m T e a m s → 40
A z u r e D a t a C e n t r e s → 5
T u r n O v e r 2 0 1 6 → 1.5b
© 2016 ||| ASOS Plc@aliostad @dav3green
Nick Beighton - CEO from “IT Cascade” slides - Oct 2014
ASOS - A Tech Company
© 2016 ||| ASOS Plc@aliostad @dav3green
ASOS Stock Price: 2009-2014
Multiple IT project failures
Tech issues disrupting promotions
Overdue features were not delivered
© 2016 ||| ASOS Plc@aliostad @dav3green
“Can I haz microservicez?”
“It is all a marketing hoax.”
“I dunno…” The sceptic…
© 2016 ||| ASOS Plc@aliostad @dav3green
Scaling People not the solution
↓Complexity of each service at the cost of ↑overall solution
Frequent and independent Deployments
Decentralising decision centres
Governance and EA is different
Auftragstaktik Doctrine is the conceptual underpinning of HOW to think and operate effectively; teaching leaders WHAT to think is dogma…
Auftragstaktik encourages commanders to exhibit initiative, flexibility and improvisation while in command…
In what may be seen as surprising to some, Auftragstaktik empowers commanders to disobey orders and revise their effect as long as the intent of the commander is maintained…
© 2016 ||| ASOS Plc@aliostad @dav3green
SOA Microservices
Main Goal Architectual Decoupling Agility
Audience Mainly Architecture Everyone (inc Buisness)
Set out to solve Architectural CouplingScaling People,
Frequent DeploymentImpact on Structure of
OrganisationMinimal Huge
Service Cardinality Usually up to a dozen >40 (Commonly >100)
When to do Always teams > ~5**
Law Conway’s Reverse Conway’s
© 2016 ||| ASOS Plc@aliostad @dav3green
Principles (ASOS)
* All queries and commands through HTTP API (No ESB-like pseudo-Microservices!)
*Microservices can subscribe to events raised by other Microservices
**
Each Microservice owns a business responsibility and defines a clear boundary for communication (APIs and Events)
They own their data (all access to data through API only)
* Each Microservice is realised in one (sometimes more) physical components
© 2016 ||| ASOS Plc@aliostad @dav3green
Domain Modelling
Operating ModelPeople
Successful Architecture
© 2016 ||| ASOS Plc@aliostad @dav3green
Two-speed ITEnterprise Domain
Digital Domain
• Predominantly “Buy” • Integrated at top tier • Minimal Engineering • Project-centric
• Predominantly “Build” • Drives sales and customer
touchpoint • Product-centric • Downtime unacceptable
© 2016 ||| ASOS Plc@aliostad @dav3green
Digital Domains & PlatformsThis is Domain
This is Platform
Logical Services
•“Domains” are ASOS’ organisational structure for managing Platform Teams
• Platform Teams look after collections of aligned services. They are accountable for the full lifecycle management
© 2016 ||| ASOS Plc@aliostad @dav3green
Operating ModelIndicative Team Numbers
6 Digital Domains
19 Platforms
35 Dev / Scrum teams
24 Solution Architects
700+ people in Technology (2500 in Asos total)
Avg +20 people per month over last year
© 2016 ||| ASOS Plc@aliostad @dav3green
- Recommendations as a destination
- Widgets
- Personalisation
© 2016 ||| ASOS Plc@aliostad @dav3green
1 x Soft Store (Redis)
5 x Redis Caches
3 x Cloud Services (Microservie)
2 x SQL Databases
5 x Table Storages
1 x External API
1 x Elasticsearch cluster
© 2016 ||| ASOS Plc@aliostad @dav3green
<SQL> Models
<uservice> Recommendations
API
<uservice> Composition
API
<uservice> Feedback
API
<External API> Product Catalogue
API
<SQL> Signal
<Redis> Realtime
<Elasticsearch> Catalogue
Computation/Retrieval Filtering Faceting
Authentication Composition Pagination
© 2016 ||| ASOS Plc@aliostad @dav3green
A P
I
Application Logging
Microservice Component
cidETW
cid
Thread.CurrentThread.SetLogicalData(…) [EventSource.ActivityId does not flow
over async methods]
SLAB Azure Table Storage Sink
Application Code
cid
To other APIs
cid
Raising Events
Listener
EC
cid
IIS Logs
© 2016 ||| ASOS Plc@aliostad @dav3green
A P
I
PerformanceMicroservice Component
WAD Windows Azure
Monitoring Agent
CPC
CPC: Custom Performance Counters Inst: Instrumentation
Perfit Library
SLAB Azure Table Storage Sink
Application Code
Inst
Inst
Call to Data Stores or other services
CPC
© 2016 ||| ASOS Plc@aliostad @dav3green
WoodpeckerFor `Pull` (rather than `Push`) metrics
Queue Depth/Size
Azure SQL Diagnostics
Canaries and Health Endpoints
© 2016 ||| ASOS Plc@aliostad @dav3green
Logsink API
For Native and Web Clients
A P
I
Logsink
/logchannels/<channel>
GET /logchannels/channelOne?a=b&c=d HTTP1.1
200 OK Content-Type: image/gif
POST /logchannels/channelOne?a=b HTTP1.1 {
“c”: “d” }
202 Accepted
POST /logchannels/_bulk HTTP1.1 [
{“channel”: “…”, “payload”: {...} } ]
202 Accepted [
{“status”: 202}, ... ]
Channels Config
EventHub
© 2016 ||| ASOS Plc@aliostad @dav3green
ConveyorBelt
Performance Counters
ConveyorBelt
Azure WAD logs
ETW Logs
Elasticsearch
Highly Available Headless Cluster shovelling data to ES
Instrumentation Logs
IIS Logs
Woodpecker Outputs (Pull Logs)
Sources Config
Up to 1TB/day
© 2016 ||| ASOS Plc@aliostad @dav3green
AlertingElasticsearch
Platform Team LMA Support
Watch
OAT Spec
EC
1st-2nd line Support
- xxx EC seen more than 10 times over the last minute. Back-off for 15 minutes - 90th percentile of API response > 100ms over
the last hour... Back-off for an hour
© 2016 ||| ASOS Plc@aliostad @dav3green
Lessons Learnt‣In cloud? Design for failure… “Cloud is a Jungle”
‣Network latency & failures add up: understand and optimise time from
the user to the data
‣Using any cloud technology? Forget the hype and trust no one: test,
measure, adopt/drop, monitor, engage with your provider
‣Managing platform costs can be difficult
‣Distributed computing is hard, making it geo-distributed even harder
‣Expect to roll your sleeves up: maturity in a lot of areas is can be low
‣ (platform, tooling, skills, supporting technologies) but is changing rapidly
‣At this scale, owning your LMA data and process very important
© 2016 ||| ASOS Plc@aliostad @dav3green
ASOS is Hiring!If you are intrigued by what we do,
we would love to hear from you!
Just get in touch with us in twitter @aliostad @dav3green
© 2016 ||| ASOS Plc@aliostad @dav3green
References and external artwork used
Adrian Cockcroft talk: Simplifying the future
Work in progress: Picture
Rusty Rolls Royce: Picture
Tesla S Blueprint: Picture
Two-Speed (Slow Lane, Fast Lane): Picture
Copyright of the artworks listed here belong the owners specified in the links below