How to slice your monolithic webapp using MicroApps architecture

Post on 14-Apr-2017

168 views 2 download

transcript

How to slice your monolithic webapp

using

value.quality.scale

MicroApps architecture

@yonatanm

value.quality.scale

Outbrain

0.5B> 250BUnique Visitors

RECS PER Month

once upon a time...

* Multiple teams* Multiple products* More and more features

* Multiple teams* Multiple products* More and more features

A few years later

What's the tech-debt level ?

Question #1

Answer #1

Now what ?

Want to buy a MicroService?

* Hiding impl. details* Deploy independently* Robustness by isolation* Independence / Autonomy

* Hiding impl. details* Deploy independently* Robustness by isolation* Independence / Autonomy

MicroServices naive Arch

app1

AuthO

APP2

AuthO

APP3

AuthO

MicroApp1

http://mysite1/**http://mysite2/**http://mysite3/**

AOTHEN

SECURITY

SESSION

AOTHEN

SECURITY

SESSION

AOTHEN

SECURITY

SESSION

* Sessions

* Security

* Allow-Origin CORS

* Reuse common interceptors?

* Sessions

* Security

* Allow-Origin CORS

* Reuse common interceptors?

MicroServices naive Arch

MicroApps Arch

Authentication && SECURITY && Session

app1/ /**Proxy

app2/ /**Proxy

app1

AuthO

APP2

AuthO

APP3

AuthO

app3/ /**Proxy

MicroApp1

GateWAY

Service

http://mysite/app1http://mysite/app2 http://mysite/app3

How to get there?

Question #2

How to get there?

Answer #2

* Define your areas

* Map the areas

* Change routs if needed

* Define your areas

* Map the areas

* Change routs if neededapp1/

/**app2/

/**

Step #1 towards MicroApps

LEGACYwebapp

Proxy and all that Jazzapp1

Auth

MicroApp

App1Proxy

* Routing* Handles inbound request* Handles outbound responses

* Routing* Handles inbound request* Handles outbound responses

LegaCYWeb App

app1/

/**GateWAYService

The Proxy Protocol

App1Proxy

app1

Auth

MicroApp

* Session header

* Specific cookie

* User's IP

* Session header

* Specific cookie

* User's IP

* Body

* Encoding

* HTTP Status

* Body

* Encoding

* HTTP StatusLegaCYWeb App

GateWAYService

Know your Proxy

* The Proxy Protocol

* Connection pool

* Performance metrics

* Failures metrics

* logs

* The Proxy Protocol

* Connection pool

* Performance metrics

* Failures metrics

* logs

Infrastructure as a service

* Session as a service* SSL* Access logs* Security* Monitoring* CDN integration

* Session as a service* SSL* Access logs* Security* Monitoring* CDN integration

Authentication && SECURITY && Session

app1/ /**Proxy

app2/ /**Proxy

app3/ /**Proxy

GateWAY

Service

Technology

* Custom technology stack * Reducing tech debt* Gradual upgrade* Velocity && Quality

* Custom technology stack * Reducing tech debt* Gradual upgrade* Velocity && Quality

Culture

* Autonomy and Freedom

* Clear ownership

* Focus

* Responsibility <> Accountability

* Autonomy and Freedom

* Clear ownership

* Focus

* Responsibility <> Accountability

I did it my Way

Giving ppl as much as possible to do their jobGiving ppl as much as possible to do their jobfreedom

* Another moving part

* Latency

* hard to compete HAProxy

* no more one CSS to rule them all

* Another moving part

* Latency

* hard to compete HAProxy

* no more one CSS to rule them all

* Initiated ~ 2yrs ago* 6+ MicroApps – different teams – different technology stack* Gradual roll-out * WIP - Rewrite Gateway Service

* Initiated ~ 2yrs ago* 6+ MicroApps – different teams – different technology stack* Gradual roll-out * WIP - Rewrite Gateway Service

In MicroApps

Future work

* Circuit breaker

* Reusing web resources

* Open source it ?

* Circuit breaker

* Reusing web resources

* Open source it ?

Thank You

Q && A

value.quality.scale

Want to know more about

Contact me

Want to know more about

Contact me

Outbrain's Architecture?