microservices in production

23
Microservice s in Production Võ Duy Tuấn CEO/Founder Teamcrop.com

Upload: vo-duy-tuan

Post on 16-Jan-2017

1.848 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Microservices in production

Microservices in Production

Võ Duy TuấnCEO/FounderTeamcrop.com

Page 2: Microservices in production

• Why Microservices?

• DEV:o Micro-framework

o Bounded context

o Inter-service communication

o API gateway

o Single Page App (SPA)

Table of contents

• OPS:o Docker

o Configuration

o Logging & monitoring

o Service discovery

o CI/CD

Page 3: Microservices in production

Why Microservices?

- Website Modules

- 3rd-party Web Service

- Mobile App Web Service

- Small team

- Scalability

Page 4: Microservices in production

DEV(Development)

Page 5: Microservices in production

DEV / Micro-framework

• Easy to learn• Easy to code• Easy to run• Easy to test• Easy to deploy• Easy to upgrade• Restful Web Service• Slim framework

Page 6: Microservices in production

DEV / Bounded context

Page 7: Microservices in production

DEV / Inter-service communication

• Authentication:– Json Web Token (JWT)– Access Trusted Network

• Communications:– Restful (HTTP)– SOAP (HTTP)– AMQP– App specific: Redis…– Protobuf

Page 8: Microservices in production

DEV / API Gateway

CLIENT

SHIPMENTGATEWAY

Giaohangnhanh Viettel Post VNPost

RESTful SOAP SOAP

Page 9: Microservices in production

DEV / Single Page App (SPA)

• Require JS• Backbone JS• React JS• jQuery• Semantic UI• Custom Icon Font• Gulp• Phonegap

Page 10: Microservices in production

OPS(Operations)

Page 11: Microservices in production

OPS / Docker

sudo wget -qO- https://get.docker.com/ | sh

Page 12: Microservices in production

OPS / Configuration

Page 13: Microservices in production

OPS / Configuration (cont.)

Page 14: Microservices in production

OPS / Logging / API Log

Micro-Framework’s Middleware

Page 15: Microservices in production

OPS / Logging / System & Custom Log

• Graphite: metric and log data store.• Collectd: syslog and software metric collector.• Grafana: Front-end, chart builder.• Statsd: graphite proxy for other programming

languages.

Page 16: Microservices in production

OPS / Logging / System & Custom Log

Docker image: voduytuan/tc-graphite

Page 17: Microservices in production

OPS / Monitoring

API Status Monitoring from statuscake.com

Page 18: Microservices in production

OPS / Service discovery

Page 19: Microservices in production

OPS / Service discovery (cont.)

Page 20: Microservices in production

OPS / Service discovery (cont.)

HAProxy

Consul-template

Docker Engine

Backend 01 : Port 32680

Backend 02 : Port 32681

Backend 03 : Port 32682

Update haproxy.cfg& Reload haproxy

CONSUL REGISTRATOR

Notify

Update

Pull1

2

3

45

Client

gliderlabs/registratorgliderlabs/consul-server

Page 21: Microservices in production

OPS / Service discovery (cont.)

Sample template of Haproxy, will parsed by Consul-template

Page 22: Microservices in production

OPS / Continuous Integration / Continuous Deployment

Page 23: Microservices in production

Thanks!CONTACT:[email protected]

0938 916 902

teamcrop.com