a competitive food retail architecture with microservices€¦ · - split the original feature into...

31
A competitive food retail architecture with microservices A three year journey towards microservices / JUG Saxony Day 2017 Ansgar Brauner & Sebastian Gauder @a_brauner & @rattakresch

Upload: others

Post on 20-May-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

A competitive food retail architecture with microservicesA three year journey towards microservices / JUG Saxony Day 2017

Ansgar Brauner & Sebastian Gauder

@a_brauner & @rattakresch

Page 2: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Agenda

1) Who we are and where we come from

a) REWE Group & REWE digital

2) How to ...

a) … scale monoliths?

b) … determine boundaries?

c) … guide developers?

d) … access a microservice architecture?

3) Questions?

Page 3: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Our history

Page 4: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

4

Details REWE GROUPTurnover

>54 bn

History

90 years

Employees

>330.000

InudstriesFood Retail,

Tourism, DIY

Shops

>15.000

Page 5: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Our history (Spoiler alert)

Page 6: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

How to scale monoliths?

Page 7: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Design Goals

Vertical Boundaries

Decentralization

Page 8: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

“Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the

organization's communication structure.”Melvin Conway (1967)

Conway’s law

Page 9: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

How to organize teams to build a scalable system?Functional and vertical teams

Page 10: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

How to determine boundaries?

Page 11: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Customer journey defines bounded contexts

Page 12: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

How to guide developers?

Page 13: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Design Goals- Vertical boundaries

- Decentralization

Architectural principles- Collection of 9 basic ‘laws’

- Autonomy, Automation and Communication

Guides- Practical manual for common tasks (RFC 2119)

- e.g. Eventing, REST, Authentication

Guarding rails for developers

MUSTSHOULDCOULD

Page 14: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

autonomy

Page 15: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Autonomy principles

Deploy independentlyEnsure that the services can and are deployed by the teams themselves.

Isolate failureMake the services as resilient as possible.

Hide implementation DetailsDifferent verticals must not share state. Verticals hide their implementation details.

Encapsulate Data StorageFor any data resource exactly one service is responsible. If possible, the data supply should proceed asynchronously in

the background

Page 16: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Autonomous Teams - challenge for product owners as they have to rethink their features

- they might have to reduce the scope

- split the original feature into smaller ones for each team / bounded context

Data-integration pattern- Change your service behavior depending on the data you have to display

- Enable others to deliver functionality later

Evolving Implementations- Start with a fitting but simple solution and get better by every team implementing it

Challenges

Page 17: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

automation

Page 18: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Automation principles

Be ScalableServices are scaled horizontally

Embrace a Culture of AutomationTest, deployment and operations are completely automated

Be Highly ObservableUse of semantic monitoring to see if the whole platform works correctly.

Page 19: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

communication

Page 20: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Communication principles

Follow REST PrinciplesThe API of a service follows the RESTful paradigm

Standardize Service communicationInter-service communication is standardized and if possible asynchronous

Page 21: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Asynchronous > Synchronous- Have as much needed data locally as possible -> resilience at request time

- Duplication of data is accepted and wanted

- Only communicate synchronously if

- process needs to be synchronous

- data is not available asynchronously (yet)

Communication in microservice worldsHaving data is better than fetching data

Page 22: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Eventing with Apache Kafka● Eventing != Messaging

○ Publish events that already happened

○ One owning service per queue/topic

○ Independence at request time

● Complete entities - not deltas

○ Atomic

○ Allows log compaction

● Re-writing and Re-reading

○ needed in case of additional data

○ useful in case of data loss

Page 23: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Kafka is an API as well- Events have to behave like APIs and avoid breaking changes.

Writing APIs is hard- Teams tend to write APIs for special clients (e.g. mobile apps)

- New clients often don’t match and require API changes

Breaking changes require a strict procedure- Could be solved by new endpoints, new topics

Lessons learned with microservice APIs

Page 24: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Breaking changes in APIs

Page 25: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

How to access?

Page 26: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Usage of API gateways as entry pointsHow to access Microservices?

Page 27: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Dynamic frontend compositionHow UIs in microservice architectures should be composed

Page 28: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Dynamic UI Composition with DUCConstraints

- There is no dedicated FE Team- CSS and JavaScript are delivered from the services- A/B testing should be possible in all services- Authentication and request-enhancement is handled in the gateway component

Page 29: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Dynamic UI composition with DUCWhere does my UI come from?

Page 30: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

Thank youQuestions ?

Page 31: A competitive food retail architecture with microservices€¦ · - split the original feature into smaller ones for each team / bounded context Data-integration pattern - Change

A competitive food retail architecture with microservicesA three year journey towards microservices / JUG Saxony Day 2017

Ansgar Brauner & Sebastian Gauder

@a_brauner & @rattakresch