the frontend taboo - goto conference · a story of full stack micro-services the frontend taboo...

51
A STORY OF FULL STACK MICRO-SERVICES THE FRONTEND TABOO GOTO 15.11.2016 BERLIN, GERMANY LUIS MINEIRO @voidmaze MORITZ GRAUEL @mo_gr

Upload: others

Post on 20-May-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

A STORY OF FULL STACK MICRO-SERVICES

T H E F R O N T E N D TA B O O

G O TO 1 5 . 11 . 2 0 1 6 B E R L I N , G E R M A N Y

L U I S M I N E I R O @voidmaze

M O R I T Z G R A U E L @mo_gr

Page 2: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

FA S H I O N S TO R E W E B S I T E

Page 3: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

M O B I L E A P P S

iOSAndroid Windows Mobile

Page 4: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

S H O E S I N S PA C E

https://tech.zalando.de/blog/we-launched-it-the-zalando-space-shoe-video/

Page 5: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

Z A L A N D O I S H U G E !

~ E U R 3 B N R E V E N U E > 1 6 0 M V I S I T S P E R M O N T H > 11 , 0 0 0 E M P L O Y E E S I N E U R O P E > 1 , 6 0 0 T E C H E M P L O Y E E S

7 T E C H H U B S B E R L I N H E L S I N K I D U B L I N A N D M O R E …

F U T U R E Z A L A N D O C A M P U S

Page 6: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

6

C H A L L E N G E S

Page 7: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

E F F E C T S O N P R O D U C T I V I T Y

011010011101010010111010111011

DEPENDENCIES

HUGE CODEBASE

COORDINATION

LAW OF DIM

INISHING RETURNS

Page 8: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

E F F E C T S O N I N N O VAT I O N

011010011101010010111010111011

SIDE EFFECTS

RIGID PROCESSES

LESS INNOVATIO

N

HUGE CODEBASE

BUG DENSITY

Page 9: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

E F F E C T S O N G R O W T H

011010011101010010111010111011

OLD TECH STACK

LESS MAGNETISM

SLOW HIRING

HUGE CODEBASE

SLOW ONBOARDING

Page 10: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

C O N WAY ’ S L AW

Organizations which design systems

are constrained to produce designs

which are copies

of the communication structures

of these organizations. Melvin Edward Conway

Page 11: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

11

R A D I C A L A G I L I T Y

Page 12: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

WE WANTAUTONOMOUS TEAMS

TO DELIVER

AMAZING PRODUCTS

EFFICIENTLY

AT SCALE

Page 13: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr
Page 14: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

R A D I C A L A G I L I T Y

A P U R P O S E - D R I V E N O R G A N I S AT I O N

C O M P O S E D O F

A U TO N O M O U S T E A M S

W H I C H D E L I V E R

C L E A R LY D E F I N E D P R O D U C T S

A S E RV I C E - O R I E N T E D A R C H I T E C T U R E

C O M P O S E D O F

L O O S E LY C O U P L E D E L E M E N T S

T H AT H AV E

B O U N D E D C O N T E X T S

Adrian Cockcroft

Page 15: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

1 5

T H E F R O N T E N D TA B O O

Page 16: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

T H E P R O M I S E O F M I C R O - S E RV I C E S

work autonomously

mix of different technology stacks

independent release cycles

Page 17: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

T E A M S O W N B A C K E N D A P I S

TEAM GILFOYLETEAM DINESH

Page 18: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

A P I S A R E U S E D B Y A F R O N T E N D M O N O L I T H

WEBAPP

TEAM GILFOYLETEAM DINESH

CUSTOMER

Page 19: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

W E B A P P G E T S C O N T R I B U T I O N S F R O M M U LT I P L E T E A M S

TEAM GILFOYLE TEAM DINESHWEBAPP

Page 20: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

T H E P R O M I S E O F M I C R O - S E RV I C E S R E V I S I T E D

work autonomously?

mix of different technology stacks?

independent release cycles?

Page 21: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

T H E P R O M I S E O F M I C R O - S E RV I C E S R E V I S I T E D

work autonomously?

mix of different technology stacks?

independent release cycles?

Page 22: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

T H E P R O M I S E O F M I C R O - S E RV I C E S R E V I S I T E D

work autonomously?

mix of different technology stacks?

independent release cycles?

Page 23: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

T H E P R O M I S E O F M I C R O - S E RV I C E S R E V I S I T E D

work autonomously?

mix of different technology stacks?

independent release cycles?

Page 24: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

2 4

C A N W E D O B E T T E R ?

Page 25: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

2 5

H T T P S : / / Y O U T U . B E / P J O V C 3 M E I W S

Page 26: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

M O S A I C

h t t p s : / / w w w. m o s a i c 9 . o r g

Page 27: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

T E A M S O W N F R A G M E N T S

TEAM HADOUKEN TEAM PINGPONG

Page 28: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

F R A G M E N T S U S E T H E B A C K E N D A P I S

TYPICAL MICRO-SERVICES LAYER

TEAM HADOUKEN TEAM PINGPONG

Page 29: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

L AY O U T S E RV I C E A S S E M B L E S F R A G M E N T S

TYPICAL MICRO-SERVICES LAYER

TEAM HADOUKEN TEAM PINGPONG

L AY O U T S E RV I C E T E M P L AT E S

Page 30: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

A S S E M B L E D C O N T E N T I S S T R E A M E D TO T H E C L I E N T

TYPICAL MICRO-SERVICES LAYER

TEAM HADOUKEN TEAM PINGPONG

L AY O U T S E RV I C E T E M P L AT E S

R O U T E R R O U T E S

C U S TO M E R

A P I C A L L S

Page 31: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

M O S A I C C O M P O N E N T S

TYPICAL MICRO-SERVICES LAYER

TEAM HADOUKEN TEAM PINGPONG

TA I L O R T E M P L AT E S ( Q U I LT )

S K I P P E R R O U T E S ( I N N K E E P E R )

C U S TO M E R

A P I C A L L S

Page 32: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

3 2

R O U T I N G

Page 33: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

• Forwards requests to different endpoints based on request properties:

• Host, Path, Method • Cookies, etc

• Adds security features • Encrypts/decrypts sensitive cookies at the edge • XSRF protection

• Streams content from the endpoints with regular flushing

• Runtime updates of routing table

• Written in go

S K I P P E R

https://github.com/zalando/skipper

Page 34: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

R O U T I N G

TA I L O R

S K I P P E R

C U S TO M E R

Path = /api/cart011010011101010010111010111011

Path = /*

Path = /products/*.html

J I M M Y

Page 35: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

E S K I P R O U T I N G D E F I N I T I O N L A N G U A G E

A domain-specific language (DSL) for describing Skipper route expressions, route definitions and complete routing tables.

Route = n Predicates + m Filters + 1 backend

catalog: Path("/*category") -> "https://catalog.example.org";productPage: Path("/products/:id") -> "https://products.example.org";userAccount: Path("/user/:id/*userpage") -> "https://users.example.org";

// 404notfound: * -> modPath(/.+/, "/notfound.html") -> static("/", "/var/www") -> <shunt>

Page 36: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

P R E D I C AT E S

One or more conditions. An incoming request must fulfil each of them to match.

Many built in predicates for pretty much everything around HTTP requests.

Skipper is easily extendable with custom predicates

Path("/api/*resource") && Header("Accept", "application/json")

PathRegexp(/regular-expression/)Method("HEAD")Header("Accept", “application/json")Any()

Page 37: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

F I LT E R S

Filters are used to augment the incoming requests and the outgoing responses, or do other useful or fun stuff.

A lot of built in filters give a lot of powerful features

Skipper is easily extendable with custom filters

setResponseHeader("max-age", "86400") -> static("/", "/var/www/public")

static("/images", "/var/www/images")status(418)redirectTo(302, “https://ui.example.org")dropRequestHeader(“header-name")flowId("reuse", 64)

Page 38: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

• API Gateway • Split mobile and desktop traffic • Split traffic based on version header

• OAuth authentication reverse proxy • In front of a third-party service that doesn’t support OAuth • Redirect unauthenticated requests to other endpoint

• Weighted traffic control • Use the same route with different endpoints • Stickiness via cookies

• HTTP file server

• HTTP compression proxy

• Custom predicates + custom filters = you name it

F L E X I B L E A N D O P E N F O R I N D I V I D U A L C R E AT I V I T Y

Page 39: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

3 9

C O M M U N I C AT I O N

Page 40: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

• Fragments are regular HTTP endpoints

• Fragments respond with HTML fragments (no <head>/<body>)

• Communication based in HTTP Headers

• No custom/complex protocol

F R A G M E N T S

Page 41: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

4 1

C O M P O S I T I O N

Page 42: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

• Tailor is a layout service that uses streams to compose a web page from fragment services.

• Loads content of all fragments from the template in parallel

• Initialises fragments client-side code

• Offers nice error handling and fallback features with circuit breakers

• Written in Node

https://github.com/zalando/tailor

TA I L O R

Page 43: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

C O M P O S I T I O N

TA I L O R

header.domain.com footer.domain.com

product.domain.com

Page 44: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

T E M P L AT E

<html> <head> <fragment src="http://assets.domain.com"></fragment> </head> <body> <fragment src="http://header.domain.com"></fragment> <fragment src="http://content.domain.com" primary></fragment> <fragment src="http://footer.domain.com" async></fragment> </body> </html>

Page 45: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

T E M P L AT E

<html> <head> <fragment src="http://assets.domain.com"></fragment> </head> <body> <fragment src=“http://header.domain.com" timeout=“500” fallback-src=“http://header.static.domain.com” async/> <fragment src="http://content.domain.com" primary/> <fragment src="http://footer.domain.com" async/> </body> </html>

Page 46: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

4 6

R E S U LT

Page 47: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

H O W D O E S I T L O O K ?

Header Fragment

Cart Fragment

Base Assets Fragment

Tracking Fragment } Not every fragment has to be visible

Footer Fragment

Page 48: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

R E S U LT

- runtime injection of new features - faster feedback loops - tech agnostic

- end-to-end responsibility - full control - lean, agile processes - independent development - continuous delivery

- faster onboarding - magnetic - easy to spin-off new teams

PRODUCTIVITYINNO

VATI

ON

GROWTH

Page 49: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

4 9

D E M O

Page 50: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

T H A N K Y O U

Q U E S T I O N S ?

h t t p s : / / w w w. m o s a i c 9 . o r g h t t p s : / / z a l a n d o . g i t h u b . i o

Page 51: THE FRONTEND TABOO - GOTO Conference · a story of full stack micro-services the frontend taboo goto 15.11.2016 berlin, germany luis mineiro @voidmaze moritz grauel @mo_gr

@ZalandoTech tech.zalando.com

L U I S M I N E I R O

@voidmaze [email protected]

M O R I T Z G R A U E L

@mo_gr [email protected]

1 5 - 11 - 2 0 1 6