Download - Microservice no fluff, the REAL stuff
![Page 1: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/1.jpg)
@nklmish
MicroserviceNo fluff, the REAL stuff
The best preparation for tomorrow is doing your best today
@nklmish
![Page 2: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/2.jpg)
@nklmish
Agenda
Common Problems
Microservice - core concepts
Pros & Cons
Code
![Page 3: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/3.jpg)
@nklmish
About me
Senior Software developer at 4FinanceIT
Consultant and architect around JVM technology
![Page 4: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/4.jpg)
@nklmish
Monolithic ?
![Page 5: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/5.jpg)
@nklmish
Common Problems
![Page 6: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/6.jpg)
@nklmish
Too much complexity needs to be exposed
![Page 7: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/7.jpg)
@nklmish
legacy components - Hard to upgrade
![Page 8: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/8.jpg)
@nklmish
Workaround
![Page 9: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/9.jpg)
@nklmish
New functionality can just pop
![Page 10: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/10.jpg)
@nklmish
Easy to maintain standards, hard to maintain quality
![Page 11: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/11.jpg)
@nklmish
Easy to maintain quality, hard to maintain standards
![Page 12: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/12.jpg)
@nklmish
Refactoring
(Before)
![Page 13: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/13.jpg)
@nklmish
Refactoring
(After)
![Page 14: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/14.jpg)
@nklmish
Microservices
![Page 15: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/15.jpg)
@nklmish
Microservices
1
Application
2 3 4 5
6 7 8 9 N
![Page 16: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/16.jpg)
@nklmish
Core Concepts
![Page 17: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/17.jpg)
@nklmish
Concept 1 : Service Registry
![Page 18: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/18.jpg)
@nklmish
Service Registry
Zookeeper Eureka ConsulConsistency
Partition
Availability
PartitionAvailability
Partition
![Page 19: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/19.jpg)
@nklmish
Eureka
Components:
Server - REST service
Client - Java component (Used within a microservice)
![Page 20: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/20.jpg)
@nklmish
Eureka Client Server CommunicationClien
t
Serv
er
Registration: first heartbeat (after 30s)
Renew lease: heartbeat/30s
Fetching Registry: retrieve & cache it locally
Registry Update: /30s
Shutdown: Cancel request on shutdown
Renew fail
ure:
No heart
beat for
90s,
REMOVE
Shutdow
n:
Removes
instance
from reg
istry
![Page 21: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/21.jpg)
@nklmish
Concept 2 : Load balancing
![Page 22: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/22.jpg)
@nklmish
Ribbon
Client side load balancer
Built-in Failure resiliency
Rule based load balancing
![Page 23: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/23.jpg)
@nklmish
Concept 3 : Edge Service
![Page 24: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/24.jpg)
@nklmish
Zuul
Error
RoutingPre PostRequest
Response
![Page 25: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/25.jpg)
@nklmish
Zuul features
Load Shedding
Authentication & Security
Static Response handling
Surgical Debug Filter
Stress Testing
![Page 26: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/26.jpg)
@nklmish
Concept 4 : Failure management
![Page 27: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/27.jpg)
@nklmish
Hystrix
Manage failures(latency + fault tolerance)
Cascading failures
Fail fast approach
![Page 28: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/28.jpg)
@nklmish
Pros & Cons
![Page 29: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/29.jpg)
@nklmish
Pros
Component
Richer tech stack
Scalability
Resilience
![Page 30: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/30.jpg)
@nklmish
Cons
Distributed system.
Arsenal of tools (Infrastructure)
Testing
Transactions
![Page 31: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/31.jpg)
@nklmish
DEMO
![Page 32: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/32.jpg)
@nklmish
Demo
Spring Cloud OSS
http://tiny.cc/micro-code
![Page 33: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/33.jpg)
@nklmish
Spring Cloud
![Page 34: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/34.jpg)
@nklmish
DEMO
CATALOG SERVICE
PRODUCT SERVICEPRICE
SERVICECOMMENT SERVICE
![Page 35: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/35.jpg)
@nklmish
Microservice in REAL life
![Page 36: Microservice no fluff, the REAL stuff](https://reader031.vdocument.in/reader031/viewer/2022021815/5876050b1a28ab4a508b66b1/html5/thumbnails/36.jpg)
@nklmish
Metrics