Microservices: The Netflix Way

Post on 22-Jan-2018

386 views 2 download

Transcript of Microservices: The Netflix Way

1

©2017PuneetSachdev|Allrightsreserved©2017PuneetSachdev|Allrightsreserved

Microservices:TheNetflixWay

21st April2017

HandsonWorkshop

DevOps,MicroservicesandContainersSummit– Delhi

Puneet Sachdev Chief Architect - Agile, DevOps and Product EngineeringNIIT Technologies https://www.linkedin.com/in/puneetsachdev

2

©2017PuneetSachdev|Allrightsreserved©2017PuneetSachdev|Allrightsreserved

3

©2017PuneetSachdev|Allrightsreserved©2017PuneetSachdev|Allrightsreserved

4

©2017PuneetSachdev|Allrightsreserved

Microservicesvs.SOAvs.APIs

Microservicesisaboutsplittingasingle

applicationintosmallerpieceswhichare

independentandhavetheirownlifecycle

5

©2017PuneetSachdev|Allrightsreserved

Microservicesvs.SOAvs.APIs

CRM DW Finance Loyalty

SOAisaboutintegratingdifferentapplications

whichcanbeinternalor3rd party

6

©2017PuneetSachdev|Allrightsreserved

Microservicesvs.SOAvs.APIsSOA Microservices

• Integrationbetweendifferentapplications • Splittinganapplicationintosmallerpieces

• Dominatedbyproprietarystacks • DominatedbyOpenSourcecomponentsfromorganizationslikeNetflix

• SmartPipes,DumbEndpoints • Dumbpipes,SmartEndpoints

• TypicallyHub-n-Spoke.TechnologyMonoliths

• CompletelyDistributed

APIS

• APIsareinterfaceswhichareexposedeitherinternallyand/orexternallyandhavegovernanceandmanagementaroundit

7

©2017PuneetSachdev|Allrightsreserved

NetflixMicroservicesStack

ServiceDiscovery NetflixEureka

NetflixZipkin

Config NetflixArchaius

Tracing

NetflixZuul

NetflixRibbonClientLB

FaultTolerance

Proxy

NetflixHysterix

ServiceRegistrar NetflixPrana

8

©2017PuneetSachdev|Allrightsreserved

Concept1:ServiceDiscoverythroughNetflixEureka

Concept2:CircuitBreakerusingNetflixHystrix• Microservicesapplicationshavemanymovingpartsandspanacrossmultipleboundaries

• Howtopreventanetworkorservicefailurefromcascadingtootherservices?

Concept3:RealtimemonitoringusingNetflixHystrixDashboard• Whenthingsfail,itisextremelyimportanttonotewhatisfailing

• Howtomonitorinnearrealtimemanymicroservices?

Concept4:LoadBalancingusingNetflixRibbon

• Dumbpipesandsmartendpoints.Wheredoesthisleaveloadbalancing?

Concept5:Proxying usingNetflixZuul• Withdiversetraffichittingmicroservices,howtogetanabilitytoprovideintelligentfilterson

requests

• Microservicesapplicationsrunincontainerized/virtualizedandcloudenvironmentswheretheiractuallocationschangedynamically

• Howdoesaclientofaservicediscoverthelocation?

9

©2017PuneetSachdev|Allrightsreserved

Hands On Demo

Download the code from: https://github.com/psachdev6375/microservices-bootcamp

10

©2017PuneetSachdev|Allrightsreserved

SentenceMicroservices

SubjectService

VerbService

ArticleService

AdjectiveService

NounService

You saw the leaky seat

SentenceService

Download the code from: https://github.com/psachdev6375/microservices-bootcamp

2 servers • 192.168.0.4• 192.168.0.3

11

©2017PuneetSachdev|Allrightsreserved

SentenceMicroservices– Demo1

VerbService

Eureka

VerbService2

1. Start Eureka Server 2. Start Verb Microservice3. Start Verb2 Microservice4. Check Eureka console

Download the code from: https://github.com/psachdev6375/microservices-bootcamp

12

©2017PuneetSachdev|Allrightsreserved

SentenceMicroservices– Demo2

VerbService

Eureka

VerbService2

SentenceService

SubjectService

ArticleService

AdjectiveService

NounService

1. Start Eureka Server 2. Start Verb Microservice3. Start Verb2 Microservice4. Check Eureka console5. Start Sentence Service 6. See Circuit Breaker in action

Download the code from: https://github.com/psachdev6375/microservices-bootcamp

13

©2017PuneetSachdev|Allrightsreserved

SentenceMicroservices– Demo3

VerbService

Eureka

VerbService2

SentenceService

SubjectService

ArticleService

AdjectiveService

NounService

1. Start Eureka Server 2. Start Verb Microservice3. Start Verb2 Microservice4. Check Eureka console5. Start Sentence Service 6. See Circuit Breaker in action7. Hystrix Dashboard

HystrixDashboard

Download the code from: https://github.com/psachdev6375/microservices-bootcamp

14

©2017PuneetSachdev|Allrightsreserved

SentenceMicroservices– Demo4

VerbService

Eureka

VerbService2

SentenceService

SubjectService

ArticleService

AdjectiveService

NounService

1. Start Eureka Server 2. Start Verb Microservice3. Start Verb2 Microservice4. Check Eureka console5. Start Sentence Service 6. See Circuit Breaker in action7. Hystrix Dashboard8. All services running

HystrixDashboard

Download the code from: https://github.com/psachdev6375/microservices-bootcamp

15

©2017PuneetSachdev|Allrightsreserved

SentenceMicroservices– Demo5

VerbService

Download the code from: https://github.com/psachdev6375/microservices-bootcamp

Eureka

VerbService2

SentenceService

SubjectService

ArticleService

AdjectiveService

NounService

Zuul

HystrixDashboard

1. Start Eureka Server 2. Start Verb Microservice3. Start Verb2 Microservice4. Check Eureka console5. Start Sentence Service 6. See Circuit Breaker in action7. Hystrix Dashboard8. All services running9. Zuul Proxy

16

©2017PuneetSachdev|Allrightsreserved

Thank You

Chief Architect - Agile, DevOps and Product Engineering, NIIT Technologies https://www.linkedin.com/in/puneetsachdev

Puneet Sachdev