Top Banner
© 2016 ||| ASOS Plc @aliostad @dav3green Microservice Architecture at ASOS Ali Kheyrollahi
38

Microservice architecture at ASOS - CloudBrew/AZUG.be

Apr 16, 2017

Download

Software

Ali Kheyrollahi
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

Microservice Architecture at ASOS

Ali Kheyrollahi

Page 2: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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

Page 3: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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

Page 4: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

Nick Beighton - CEO from “IT Cascade” slides - Oct 2014

ASOS - A Tech Company

Page 5: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

ASOS Stock Price: 2009-2013

More than 2000% growth!

Page 6: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

ASOS Stock Price: 2009-2014

Multiple IT project failures

Tech issues disrupting promotions

Overdue features were not delivered

Page 7: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

Microservices…

why?

Page 8: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

“Can I haz microservicez?”

“It is all a marketing hoax.”

“I dunno…” The sceptic…

Page 9: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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…

Page 10: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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

Page 11: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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

Page 12: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

Domain Modelling

Operating ModelPeople

Successful Architecture

Page 13: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

ASOS Architecture

Page 14: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

ASOS Journey

Page 15: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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

Page 16: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

❤ASOS

Page 17: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

ASOS Tech Stack

Page 18: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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

Page 19: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

Page 20: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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

Page 21: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

Governance

Bottom-Up

Top-Down

Page 22: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

Microservice Example:

Recommendations

Page 23: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

- Recommendations as a destination

- Widgets

- Personalisation

Page 24: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

Page 25: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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

Page 26: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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

Page 27: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

LMA Platform

Page 28: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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

Page 29: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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

Page 30: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

WoodpeckerFor `Pull` (rather than `Push`) metrics

Queue Depth/Size

Azure SQL Diagnostics

Canaries and Health Endpoints

Page 31: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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

Page 32: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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

Page 33: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

Monitoring (Demo)

Page 34: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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

Page 35: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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

Page 36: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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

Page 37: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 2016 ||| ASOS Plc@aliostad @dav3green

Q AThank You!

Page 38: Microservice architecture at ASOS - CloudBrew/AZUG.be

© 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