Top Banner
An Introduction to Microservices Ad van der Veer [email protected]
46
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: An Introduction to Microservices

An Introduction to Microservices

Ad van der Veer [email protected]

Page 2: An Introduction to Microservices

About me

Actually a ‘Strategic Product Designer’

Page 3: An Introduction to Microservices

About me

But spend the other 50% on programming backend services

Page 4: An Introduction to Microservices

About me

But most importantly: my Graduation Project at the Delft University of Technology

Page 5: An Introduction to Microservices

Contents

Microservices: • What is it? • Why should you use it? • Why shouldn’t you use it? • How should you use it? • What’s next?

Page 6: An Introduction to Microservices

So, what the Freck is it?

Page 7: An Introduction to Microservices

Our Example: Magento ( 8,511,815 lines of code )

Page 8: An Introduction to Microservices

Breaking it up

Page 9: An Introduction to Microservices

Small? Logical?

“Write services that do one thing and do it well. Write services to work together. Write services to handle RESTful http, because that is a universal interface.”

Page 10: An Introduction to Microservices

Small? Logical?

“For us, a service is micro if we can rewrite it in 2 weeks or less”

Page 11: An Introduction to Microservices

Breaking up Magento

System

Products

Customers

EAV

Sales

Get /products/21 POST /transactions

Page 12: An Introduction to Microservices

How is this different from SOA?

- Less specs (WS-*) - Focus on being small - Fit with Agile - JSON > XML - ??

Page 13: An Introduction to Microservices

Why should you use it? (The 5 most popular PRO’s)

Page 14: An Introduction to Microservices

1. The Right Tool for the Job

System

Products

Customers

EAV

Sales

Get /products/21 POST /transactions

Page 15: An Introduction to Microservices

2. Division of Labor(before)

Page 16: An Introduction to Microservices

2. Division of Labor (after)

Get /products/21 POST /transactions

Page 17: An Introduction to Microservices

3. Cognitive Scaling (before)

Page 18: An Introduction to Microservices

3. Cognitive Scaling (after)

Get /products/21 POST /transactions

Page 19: An Introduction to Microservices

4. Limited blast radius

Page 20: An Introduction to Microservices

4. Limited blast radius

Get /products/21 POST /transactions

Page 21: An Introduction to Microservices

5. Defer Decisions

System

Products

Customers Analytics

?

Sales

Get /count

Page 22: An Introduction to Microservices

Why shouldn’t you use it? (The 5 most popular CON’s)

Page 23: An Introduction to Microservices

1. DevOps Mentality is a Must

Get /products/21 POST /transactions

Page 24: An Introduction to Microservices

2. Complexity movement

Get /products/21 POST /transactions

Page 25: An Introduction to Microservices

3. Polyglot and Shared libraries

System

Products

Customers Sales

Get /products/21 POST /transactions

Page 26: An Introduction to Microservices

4. (Integration) Testing

Sytem

Products

Sales

Page 27: An Introduction to Microservices

5. interface Management

Products

Page 28: An Introduction to Microservices

How should you use it?

Page 29: An Introduction to Microservices

‘Separation of Concerns’

At the process level: - Instances: services - interfaces: RESTful

endpoints

Page 30: An Introduction to Microservices

API Gateway

Products

Customers Sales

API Gateway: Authentication&Routing

System

Page 31: An Introduction to Microservices

HTTP (REST)

Products

Customers Sales

API Gateway: Authentication&Routing

HTTP

HTTP

HTTP

HTTP

System

Page 32: An Introduction to Microservices

Message Queue (MQ)

Products

Customers Sales

API Gateway: Authentication&Routing

HTTP

HTTP

HTTP

HTTP

HTTP HTTP

System

Page 33: An Introduction to Microservices

How to Transitioning from A Monolith?

Piece by piece: “Whenever a big new feature change came along, we asked ourselves? Can we split this into a seperate microservice?”

Sales

HTTP

Page 34: An Introduction to Microservices

Tools and Technologies (step by step)

Page 35: An Introduction to Microservices

Step1 : Write something Tools& Techs: - JAVA - Go - .Net - Node.js … Standard(s)?: Simple to run (separate) processes

Page 36: An Introduction to Microservices

Step 2: Test it Tools& Techs: - REST Clients (Paw, Postman) - Language specific

test/mock frameworks

Standard(s)?: Ad hoc testing

Page 37: An Introduction to Microservices

Step 3: Commit it Tools& Techs: - GitHub - BitBucket - Launchpad - In-house hosting Standard(s)?: Support many repo’s, easy to use (GitHub?)

Page 38: An Introduction to Microservices

Step 4: Encapsulate it Tools& Techs: - Docker - (platform specific

process encapsulation)

Standard(s): Docker

Page 39: An Introduction to Microservices

Step 5: Wire it up

Tools& Techs: - Docker based:

- (google) Kubernetes - (openshift) GearD - (spotify) Helios - Many more…

- DNS service disco - Immutable:

- Terraform & Packer Standard(s): None, very much in flux, also check: http://www.mindmeister.com/389671722/docker-ecosystem

Page 40: An Introduction to Microservices

Step 6: Keeping Track Tools& Techs: - ELK stack - Nagios - Statsd/Graphite - … Standard(s): Whatever your company is comfortable with and has support for your poly glot env

Page 41: An Introduction to Microservices

And check out..

Page 42: An Introduction to Microservices

What’s Next?

Page 43: An Introduction to Microservices

1: Docker will lead development

Page 44: An Introduction to Microservices

2: Cloud providers will create convenient services (e.i lock-ins)

Page 45: An Introduction to Microservices

3: Development tools are needed for (contract) testing and isolation

Products

Customers Sales

API Gateway: Authentication&Routing

HTTP

HTTP

HTTP

HTTP

HTTP HTTP

System

Page 46: An Introduction to Microservices

Thank you! please check out: