45
Modelling Microservices Petter Måhlén February 2016

Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Modelling MicroservicesPetter Måhlén February 2016

Page 2: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

About me

• Building software professionally since 1995 • Infrastructure at Spotify since 2013 • Service Discovery (Nameless) • Service Framework (http://spotify.github.io/apollo/) • System-Z • Currently doing Data infrastructure

Page 3: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

About this talk

1. Why model microservices? 2.Our solution: System-Z 3.Design 4.Impact so far

=> Ideas about running microservices at scale

Page 4: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Why model microservices?

Z axis: ShardingY axis: Splitting

X axis: Cloning

http://artofscalability.com/

Page 5: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Why model microservices?

Z axis: ShardingY axis: Splitting

X axis: Cloning

http://artofscalability.com/~10k servers

~1100 things

Page 6: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Why model microservices?

Z axis: ShardingY axis: Splitting

X axis: Cloning

http://artofscalability.com/

plus ~100 teams writing code

~10k servers

~1100 things

Page 7: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Spotify Organisation

Page 8: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Spotify Organisation

If you need to know exactly who is making decisions,

you are in the wrong place

https://labs.spotify.com/2014/03/27/spotify-engineering-culture-part-1/

Page 9: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Problems to Solve

Discovering and understanding: • What things are “out there” • Deployments and configurations • The system as a whole, how do things fit together? • How to get more information: ownership • What’s broken and how to fix it.

Page 10: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Our solution

Page 11: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

What came beforeEmil

Page 12: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

What came beforeEmil

ServiceDB

Page 13: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

What came beforeEmil

ServiceDB

System-Z

Page 14: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Enter System-Z

• A system for system metadata

• Z? Wat?

Page 15: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Some terminology

• Component - some thing • A microservice, data store, data

pipeline, or library • System - some related things

These terms, like most things Z, are intentionally vague

Page 16: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Main features

• General component information • Dependency Tracking • Managing deployments • Ownership and alerting

Page 17: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since
Page 18: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Track Dependencies

Page 19: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Dependency Maps

Page 20: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Deployments

Page 21: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Deployments

See what's where

Deploy stuff Host names redacted

http://github.com/spotify/helios

Page 22: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Routing

Page 23: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Ownership

Page 24: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Ownership

Page 25: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

And...

• Create new components

• Compare live configs

• Check activity (logins, system updates, etc)

• Check Global stats (Apollo versions, etc)

• API documentation

• Provision hardware

• Set up service monitoring dashboards

• Configure data processing pipeline monitoring

• …

Page 26: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Design

Page 27: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Core data model

Many many-to-many relations Features add specific data Discovery names as indirection

Page 28: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

user2

user2

login

CLIENTS

Page 29: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

user2

user2

login

user3

attributes

create

CLIENTS

Page 30: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

user2

user2

login

user2-legacy

user3

attributes

create

CLIENTS

Page 31: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

user2

user2

login

user2-legacy

user2-proxy

user3

attributes

create

CLIENTS

Page 32: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

user2

user2

login

user2-legacy

user2-proxy

user3

attributes

create

CLIENTS

Page 33: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

user2

user2

login

user2-legacy

user2-proxy

user3

attributes

create

CLIENTS

Page 34: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

user2

user2

login

user2-legacy

user2-proxy

user3

attributes

createcreate

attributes

CLIENTS

user3

Page 35: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

user2

user2

login

user2-legacy

user2-proxy

user3

attributes

createcreate

attributes

CLIENTS

user3

Page 36: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

user2

user2

login

user2-legacy

user2-proxy

user3

attributes

createcreate

attributes

CLIENTS

user3

Page 37: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

user2

user2

login

user2-legacy

user2-proxy

user3

attributes

createcreate

attributes

CLIENTS

user3

Page 38: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

user3

attributes

createcreate

attributes

CLIENTS

user3

Page 39: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since
Page 40: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

YAML files

Loose/multiple schemas Files live with code

Page 41: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Dirty Data

Organisational change => ownership confusion Infrastructure evolution => runtime confusion Owners don’t benefit from metadata quality

Page 42: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since
Page 43: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Impact

About 200 WAU/400 MAU of ~800 in TPD Teams integrating features, making them easier to find Teams talking about features => more consistent System-Z mentioned as ‘great’ in 2016 ‘What sucks’ Swiss Army Knife (good?)

Page 44: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Conclusions

Microservices => many small things, big picture is hard Metadata about microservices helps understand the system Our metadata is dirty; this is probably unavoidable

Combining many tools => better collaboration and consistency

Page 45: Modelling Microservices - Jfokus · Modelling Microservices Petter Måhlén February 2016. About me •Building software professionally since 1995 •Infrastructure at Spotify since

Questions?