microservices in action

27
Microservices in Action Bhagwat Kumar

Upload: bhagwat-kumar

Post on 15-Apr-2017

253 views

Category:

Design


0 download

TRANSCRIPT

Page 1: Microservices in Action

Microservices in Action

Bhagwat Kumar

Page 2: Microservices in Action

2

Agenda

• Traditional/Monolith Architecture• Get familiar with microservice architecture• Challenges due to distributed nature• Netflix and Spring Cloud project• Build a microservice application

Page 3: Microservices in Action

3

Traditional architecture

E-comm Web Application

Page 4: Microservices in Action

Traditional architecture cont.…Simple to

Develop Test Deploy Scale

But… Your IDE hangs Complex engogh for

new feature Adding new developer

to the team Frequent deployments

and the long running jobs

Framework stack committment

Modules not deployable independently

Page 5: Microservices in Action

Decomposition

Page 6: Microservices in Action

Decomposition cont.…

Page 7: Microservices in Action

7

What are microservices?

Microservices are a style of software architecture that involves delivering systems as a suite of very small, granular, independent collaborating services.

Page 8: Microservices in Action

8

What are microservices cont.…

Each microservice: Built around business capabilities Runs in its own process Collaborate with lightweight mechanisms e.g.

HTTP resource API, Messaging

Page 9: Microservices in Action

9

Microservices characteristics

• Componentization via Services• Organized around Business Capabilities• Smart endpoints and dumb pipes• Decentralized governance• Decentralized data management• Infrastructure Automation

Page 10: Microservices in Action

10

Microservices Benefits

• Ease of development and maintenance• Deployed independently of other services• Truly scalable systems• Fault isolation e.g. memory leak• Polyglot mode of development e.g. Nodejs

for one service and C/C++ for other

Page 11: Microservices in Action

11

Microservices challenges

• Distributed systems are harder to program, since remote calls are slow and are always at risk of failure

• Operational Complexity: You need a mature operations team to manage lots of services, which are being redeployed regularly

• Challenging to slice the app into services

Page 12: Microservices in Action

12

Fallacies of Distributed Computing

• Proved to be false in the long run• The network is reliable• Latency is zero• Bandwidth is infinite• The network is secure• Topology doesn't change• There is one administrator• Transport cost is zero• The network is homogeneous

Page 13: Microservices in Action

13

Spring Cloud and

Netflix OSS

Page 14: Microservices in Action

14

Spring Cloud and Netflix OSS

Spring Cloud integrates the Netflix components in the Spring environment in a very nice way using auto configuration and convention over configuration similar to how Spring Boot works.

Page 15: Microservices in Action

15

Spring Cloud and Netflix OSS

Page 16: Microservices in Action

16

Centralized configuration service

Page 17: Microservices in Action

17

Centralized configuration service

Page 18: Microservices in Action

18

Eureka Discovery Service

Page 19: Microservices in Action

19

Eureka Discovery Service

Page 20: Microservices in Action

20

Client Side Load balancer

Page 21: Microservices in Action

21

Client Side load-balance: Ribbon

Page 22: Microservices in Action

22

Client Side load-balance: Feign

Page 23: Microservices in Action

23

Zuul API Gateway

Page 24: Microservices in Action

24

Zuul API Gateway Cont...

Page 25: Microservices in Action
Page 27: Microservices in Action

27

Referenceshttp://martinfowler.com/articles/microservices.htmlhttp://projects.spring.io/spring-cloud/http://www.infoworld.com/article/2925047/application-development/build-self-healing-distributed-systems-with-spring-cloud.htmlhttp://blog.arungupta.me/microservice-design-patterns/https://gssachdeva.wordpress.com/2015/06/02/microservices-in-a-nutshell/http://www.slideshare.net/SpringCentral/building-a-microservice-federation-with-grailshttps://spring.io/blog/2015/07/14/microservices-with-springhttp://callistaenterprise.se/blogg/teknik/2015/04/10/building-microservices-with-spring-cloud-and-netflix-oss-part-1/