Slide 1

Slide 1 text

BECOME THE MAESTRO BECOME THE MAESTRO MICROSERVICES ORCHESTRATION WITH MICROSERVICES ORCHESTRATION WITH KONG, GALILEO & GELATO KONG, GALILEO & GELATO

Slide 2

Slide 2 text

WHO? WHO? quick intro about myself

Slide 3

Slide 3 text

GET /who HTTP/1.1 Host: www.ahmadnassri.com Accept: application/json HTTP/1.1 200 OK Date: Thu, 11 Feb 2016 10:00:00 CET Content-Type: application/json { "name": "Ahmad Nassri", "website": "ahmad.codes", "twitter": "@AhmadNassri", "city": "Toronto, Canada", "hometown": "Damascus, Syria", "bio": "Technologist, Entrepreneur, Dog Lover", "work": { "company": " ", "role": "VP, Engineering" } } Mashape.com AHMAD NASSRI AHMAD NASSRI Live in Toronto, work in San Francisco / Silicon Valley.

Slide 4

Slide 4 text

Adopted in every major industry including finance, healthcare, military, agriculture, insurance, government, media, e-commerce, retail, aviation, manufacturing and telecom.

Slide 5

Slide 5 text

WARNING WARNING BIASED OPINIONS BEYOND THIS POINT ... DUH! BIASED OPINIONS BEYOND THIS POINT ... DUH! YMMV

Slide 6

Slide 6 text

MICROSERVICES? MICROSERVICES? Martin Fowler - a definition of this new architectural term: bit.ly/ms-definition Microservice architecture patterns and best practices bit.ly/ms-patterns Resources & Reading List bit.ly/ms-resources if you're not familiar with microservices, here's your home work (links at the last slide)

Slide 7

Slide 7 text

MICROSERVICES MICROSERVICES IN PRODUCTION IN PRODUCTION everybody talks about microservices, (the theory, the tooling, best practices, etc ...) but you rarely see the complexity involved

Slide 8

Slide 8 text

EXPECTATION EXPECTATION as a team starts to venture into building a new product, they might start thinking about the architectural design pattern and see it in abstract terms

Slide 9

Slide 9 text

EXTENDED EXPECTATIONS EXTENDED EXPECTATIONS as development intensifies, the initial theory quickly evolves, more microservices are discovered (they're like pokemons, new ones keep showing up!) and throughout more tooling is introduced (cranes in pic)

Slide 10

Slide 10 text

REALITY STRIKES REALITY STRIKES the best laid plans of mice and men often go awry

Slide 11

Slide 11 text

REALITY CHECK REALITY CHECK in reality, microservices are huge in scale and require a lot of tooling and support

Slide 12

Slide 12 text

User Service Movie Service Rating Service SIMPLE MOVIE SIMPLE MOVIE RECCOMENDATIONS RECCOMENDATIONS Reeco Service quick example things start off simple

Slide 13

Slide 13 text

User Service Movie Service Rating Service SIMPLE MOVIE SIMPLE MOVIE RECCOMENDATIONS??? RECCOMENDATIONS??? Reeco Service services have to talk to each other! - mark movie as watched - check if movie exists before applying rating - check current user permissions

Slide 14

Slide 14 text

SCALING SIMPLE MOVIE SCALING SIMPLE MOVIE RECCOMENDATIONS RECCOMENDATIONS LB LB LB LB enter load balancers, service registery and discovery tools

Slide 15

Slide 15 text

GROWTH STAGE GROWTH STAGE microservices quickly increase in number to serve different business functions teams start forming around or from microservices and APIS

Slide 16

Slide 16 text

REFACTOR! REFACTOR! V2 V2 V2 V2 new hot shot joins the team, decides to re-write everything!

Slide 17

Slide 17 text

DEPENDENCIES! DEPENDENCIES! V2 V2 V2 V2 don't forget, services need to talk to each other

Slide 18

Slide 18 text

SECURITY & AUTHENTICATION SECURITY & AUTHENTICATION V2 V2 V2 V2 security can be achieved on the network layer, but also through authentication to ensure user action impersonation

Slide 19

Slide 19 text

LOGGING? LOGGING? V2 V2 V2 V2 you wanna know what's going on, don't you? and how about debugging a user transaction across all those microservices?

Slide 20

Slide 20 text

BRAIN OVERLOAD! BRAIN OVERLOAD! tables be flipping

Slide 21

Slide 21 text

DONT REPEAT YOURSELF DONT REPEAT YOURSELF Logging Load Balancing Authentication Security Monitoring Rate Limiting ... D.R.Y all common functionality and tooling should be extracted, including:

Slide 22

Slide 22 text

ENTER KONG ENTER KONG V2 V2 V2 V2 GETKong.org Kong is designed to solve the problem of abstracting common microservices & API management functionality

Slide 23

Slide 23 text

WHAT IS KONG? WHAT IS KONG? $ curl -X POST 127.0.0.1:8001/apis \ --data 'name=movies.v1' \ --data 'upstream_url=http://lb1.movies/' \ --data 'request_path=/v1/movies' $ curl -X POST 127.0.0.1:8001/apis \ --data 'name=movies.v2' \ --data 'upstream_url=http://lb2.movies/' \ --data 'request_path=/v2/movies' Open-source management layer for APIs Built with Nginx, OpenResty, Lua Configurable Through a RESTful API add powerful functionality through plugins kong nodes are stateless and horizontally scalable, with built-in auto-discovery and clustering

Slide 24

Slide 24 text

KONG PLUGINS KONG PLUGINS $ http POST :8001/apis/movies.v1/plugins \ name=loggly config.key=SECRET $ http POST :8001/apis/movies.v1/plugins \ name=rate-limiting config.hour=500 config.minutes=100 $ http POST :8001/apis/movies.v1/plugins \ name=cors config.origin=* config.methods=GET,PUT $ http POST :8001/apis/movies.v1/plugins \ name=galileo config.service_token=SECRET $ http POST :8001/apis/movies.v1/plugins \ name=ssl config.cert=@/local/path/to/cert.pem \ config.key=@/local/path/to/cert.key $ http POST :8001/apis/movies.v1/plugins \ name=oauth2 config.scopes=email,phone,address \ config.mandatory_scope=true plugins are functional lua modules that are triggered at certain points during the request life-cycle with the ability to inspect, modify, and transform the request and response objects (here I'm using HTTPie for the examples)

Slide 25

Slide 25 text

SCENARIOS SCENARIOS VPN Vendors - as external facing api gateway - as internal microservices orchestration - as vendor shield - can even chain kong

Slide 26

Slide 26 text

GALILEO GALILEO The Analytics Platform for Monitoring, Visualizing and Inspecting API & Microservice Traffic

Slide 27

Slide 27 text

GAIN INSIGHT GAIN INSIGHT Timeseries Charts See trends data down to the minute with our timeseries charting that shows how usage is changing and visually spot any anomalies. Error View Keep track of client and server errors and who is causing them so you can debug and handle the issue before it becomes a problem.

Slide 28

Slide 28 text

GAIN INSIGHT GAIN INSIGHT Custom Filtering Filter the data down to exactly what you care about and learn how clients are requesting your services and how servers are responding. Consumer Usage Get a clear picture of an individual consumers requests to figure out how they are using your services and which endpoints are most important.

Slide 29

Slide 29 text

GELATO GELATO Removes all the hassle of creating and maintaining technical docs, and makes onboarding developers easy

Slide 30

Slide 30 text

GELATO GELATO Automatic API Explorer, Markdown Editor, Developer Onboarding, Code Generation, Import Swagger or API-blueprint gelato is packed with features

Slide 31

Slide 31 text

THANK YOU THANK YOU { "speaker": { "name": "Ahmad Nassri", "website": "ahmad.codes", "twitter": "@AhmadNassri", "city": "Toronto, Canada", "bio": "Technologist, Entrepreneur, Dog Lover", "work": { "company": " ", "role": "VP, Engineering" } }, "links": [ "mashape.com", "bit.ly/ms-kgg", "bit.ly/ms-definition", "bit.ly/ms-patterns", "bit.ly/ms-resources" ] } Mashape.com