Top Banner
Microservice: starting point! 1
27

Microservice: starting point

Jan 28, 2018

Download

Technology

inovia
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: Microservice:  starting point

Microservice:

starting point!

1

Page 2: Microservice:  starting point

Monolith VS Microservices

2

Page 3: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

Monolith architecture

3

Pros

Simpler to develop at first

Deploy as a unit

Cons

Coordination overhead as team

growth

All or nothing deploy

Page 4: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

Microservice architecture

4

Pros

Each unit is simple

Independent scaling

Cons

More sophisticated tooling

Network latencies

Page 5: Microservice:  starting point

Microservices are not dragons!

Page 6: Microservice:  starting point

What to figure out?

6

Page 7: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

What to figure out?

● How to debug?

● How to handle network failures?

● How to perform remote synchronous calls?

● How to perform event based calls?

7

Page 8: Microservice:  starting point

Logs

8

Page 9: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

Logs

9

Tid: 1234

RequestId: 1

Principal: µserviceA

Tid: 1234

RequestId: 2

Principal: µserviceA

µService A µService B

µService C

Page 10: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

Logs

10

● Trace any request (In / Out)

● Identify resources

● Logs should be treated as a stream

● Logs should be readable by a machine

Page 11: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

What to figure out?

● How to debug?

● How to handle network failures?

● How to perform remote synchronous calls?

● How to perform event based calls?

11

Page 12: Microservice:  starting point

Remote synchronous calls

12

Page 13: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

µService A REST

APIµService B

Synchronous calls

13

µService A REST

APIµService B

Page 14: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

Synchronous calls

14

● Resilient

● Respect contract

● Postel Law - Robustness

● Security

Page 15: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

What to figure out?

● How to debug?

● How to handle network failures?

● How to perform remote synchronous calls?

● How to perform event based calls?

15

Page 16: Microservice:  starting point

Events

16

Page 17: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

Events

17

µService AEvent

Broker

µService B

µService C

Page 18: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

Events

18

● Low coupling

● Based on facts

● Stateless

Page 19: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

What to figure out?

● How to debug?

● How to handle network failures?

● How to perform remote synchronous calls?

● How to perform event based calls?

19

Page 20: Microservice:  starting point

Tooling

20

Page 21: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

Tooling

● Framework agnostic

● Little code base

● Tested

● Documented

21

Page 22: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

Tooling

22

Page 23: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

Event worker

23

Worker

µService

Event

Broker

Page 24: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

Event worker

24

Worker

µService

Event

Broker

Page 25: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

Event worker

25

Worker

µService

Event

Broker

ack

Page 26: Microservice:  starting point

@matterstech

@meetup_ms_paris

meetup.matters.tech

API Gateway: Nginx way

Microservice: Starting point

Introduction à Kafka

Conclusion

26

Microservices - todo list● Think

⇒ What are my business specificities

● Prepare

⇒ Make a good tooling

● Build

⇒ Enjoy Microservices!

Page 27: Microservice:  starting point

Follow us on twitter

@meetup_ms_paris

27