why do microservices need an api gateway?... pharos.sh façade pattern the facade design pattern is...

30
www.kontena.io pharos.sh Why do microservices need an API gateway?

Upload: others

Post on 11-Jun-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

Why do microservices need an API gateway?

Page 2: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

Me, myself and I

Jussi NummelinNameCurrent Work

@jnummelin / jnummelinTwitter / Github

Developer Advocate @ Kontena, Inc.

Previous Tecnotree, Digia, Tieto, Nokia, …

Bio All-around handyman on technical topics. Passionate developer and solution architectWorking with containers & microservicesfor ~4 yearsAvid fly-fisher

Page 3: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

I’ll be rambling about

MicroservicesAPIs

API GatewayPractical example, a.k.a live demo

Page 4: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

Page 5: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

Microservices – for context

Independently deployableIsolation

Loose coupling

Page 6: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

Page 7: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

Microservices – gains

Faster development cyclesQuality (long term)

Loose coupling

Page 8: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

Theroadtohellispavedwithgoodintentions

- SaintBernardofClairvaux,ca1150

Page 9: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

Page 10: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

Microservices – pains

ComplexityTraceability

Connectivity

Page 11: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

Client needs to

Adapt to internal changesSupport multiple protocols

Handle variations with each service

Page 12: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

Enter API Gateway

Page 13: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.shwww.kontena.io pharos.sh

Façade pattern

The Facade design pattern is often used when a system is very complex or difficult to understand because the system has a large number of interdependent classes or its source code is unavailable. This pattern hides the complexities of the larger system and provides a simpler interface to the client.

- Wikipedia / Gang of Four

Page 14: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

API Gateway

Intelligent service proxyMiddleware

API Optimization

Page 15: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

Page 16: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

API GW as entrypoint

Single entrypointRouting

Protocol translation?

Page 17: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

API GW as Auth enforcer

Most services need auth

Auth enforcement in each serviceVs.

One-time auth enforcement

Page 18: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

API GW as Middleware

Rate limitingCaching

AnalyticsRetry policies

Page 19: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

API GW as Traceabilityenabler

Request/response correlationTracing injection

Page 20: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

API GW vs. ESB

API GW is NOT an ESBAPI are consumption oriented

ESB is orchestration/reuse focused

Page 21: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

API GW vs. Service Mesh

Service Mesh is a network functionAPI GW exposes the services

There is a bit of overlap

Page 22: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

DevOps?

Page 23: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

API GW & DevOps

Another tool for DevOps Enabler

Continuous Delivery

Page 24: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

Apps & API GW

Dynamic configApps driven config

Page 25: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

Options

Page 26: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

API Gateways

KongTyk

ApiGeeAWS, GCP, Azure,…

Page 27: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

Page 28: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

Loadbalancer Kong

ImagesAPI

ProductsAPI

https://github.com/jnummelin/api-gw-example

Page 29: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

API Gateway

Intelligent service proxyMiddleware

Hide the complexityEnabler for DevOps

Page 30: Why do microservices need an API gateway?... pharos.sh Façade pattern The Facade design pattern is often used when a system is very complex or difficult to understand because the

www.kontena.io pharos.sh

! [email protected]

" @kontenainc

# slack.kontena.io

$ github.com/kontena/kontena

meetup.com/pro/kontena

% www.kontena.io

Thank You!