Microservices in Action
-
Upload
bhagwat-kumar -
Category
Design
-
view
249 -
download
0
Transcript of Microservices in Action
![Page 1: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/1.jpg)
Microservices in Action
Bhagwat Kumar
![Page 2: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/2.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/3.jpg)
3
Traditional architecture
E-comm Web Application
![Page 4: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/4.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/5.jpg)
Decomposition
![Page 6: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/6.jpg)
Decomposition cont.…
![Page 7: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/7.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/8.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/9.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/10.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/11.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/12.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/13.jpg)
13
Spring Cloud and
Netflix OSS
![Page 14: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/14.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/15.jpg)
15
Spring Cloud and Netflix OSS
![Page 16: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/16.jpg)
16
Centralized configuration service
![Page 17: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/17.jpg)
17
Centralized configuration service
![Page 18: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/18.jpg)
18
Eureka Discovery Service
![Page 19: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/19.jpg)
19
Eureka Discovery Service
![Page 20: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/20.jpg)
20
Client Side Load balancer
![Page 21: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/21.jpg)
21
Client Side load-balance: Ribbon
![Page 22: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/22.jpg)
22
Client Side load-balance: Feign
![Page 23: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/23.jpg)
23
Zuul API Gateway
![Page 24: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/24.jpg)
24
Zuul API Gateway Cont...
![Page 25: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/25.jpg)
![Page 26: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/26.jpg)
Let me know if you still have few questions unanswered.
[email protected]://twitter.com/bhagwatkumarhttp://www.tothenew.com/blog/author/bhagwat/
![Page 27: Microservices in Action](https://reader035.fdocuments.us/reader035/viewer/2022081505/5878c02d1a28ab26728b4e2b/html5/thumbnails/27.jpg)
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/