3rd party registration
DESCRIPTION
fgTRANSCRIPT
-
3/3/2015 3rdPartyRegistration
http://microservices.io/patterns/3rdpartyregistration.html 1/2
Microservicearchitecture(/index.html)
ThepatternsMonolithicarchitecture(/patterns/monolithic.html)Microservicesarchitecture(/patterns/microservices.html)APIgateway(/patterns/apigateway.html)Clientsidediscovery(/patterns/clientsidediscovery.html)Serversidediscovery(/patterns/serversidediscovery.html)Serviceregistry(/patterns/serviceregistry.html)Selfregistration(/patterns/selfregistration.html)3rdpartyregistration(/patterns/3rdpartyregistration.html)
Jointhemicroservicesgooglegroup(https://groups.google.com/forum/#!forum/microservices)
Gotaquestion?Contactme(https://chrisrichardson.wufoo.com/forms/zgp4xr60erb04x/)
Pattern:3rdPartyRegistrationContextYouhaveappliedeithertheClientsideServiceDiscoverypattern(clientsidediscovery.html)ortheServersideServiceDiscoverypattern(serversidediscovery.html).Serviceinstancesmustberegisteredwiththeserviceregistry(serviceregistry.html)onstartupsothattheycanbediscoveredandunregisteredonshutdown.
ProblemHowareserviceinstancesregisteredwithandunregisteredfromtheserviceregistry?
ForcesServiceinstancesmustberegisteredwiththeserviceregistryonstartupandunregisteredonshutdownServiceinstancesthatcrashmustbeunregisteredfromtheserviceregistryServiceinstancesthatarerunningbutincapableofhandlingrequestsmustbeunregisteredfromtheserviceregistry
SolutionA3rdpartyregistrarisresponsibleforregisteringandunregisteringaserviceinstancewiththeserviceregistry.Whentheserviceinstancestartsup,theregistrarregisterstheserviceinstancewiththeserviceregistry.Whentheserviceinstanceshutsdowns,theregistrarunregisterstheserviceinstancefromtheserviceregistry.
ExamplesExamplesofthe3rdPartyRegistrationpatterninclude:
NetflixPrana(https://github.com/Netflix/Prana)a"sidecar"applicationthatrunsalongsideanonJVMapplicationandregisterstheapplicationwithEureka.AWSAutoscalingGroups(http://aws.amazon.com/autoscaling/)automatically(un)registersEC2instanceswithElasticLoadBalancerRegistrator(https://github.com/gliderlabs/registrator)registersandunregistersDockercontainerswithvariousserviceregistriesClusteringframeworkssuchasKubernetes(https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md)andMarathon(https://mesosphere.github.io/marathon/docs/servicediscoveryloadbalancing.html)(un)registerserviceinstanceswiththebuiltin/implicitregistry
ResultingcontextThebenefitsofthe3rdPartyRegistrationpatterninclude:
TheservicecodeislesscomplexthanwhenusingtheSelfRegistrationpattern(selfregistration.html)sinceitsnotresponsibleforregisteringitselfTheregistrarcanperformhealthchecksonaserviceinstanceandregister/unregistertheinstancebasedthehealthcheck
Therearealsosomedrawbacks:
The3rdpartyregistrarmightonlyhavesuperficialknowledgeofthestateoftheserviceinstance,e.g.RUNNINGorNOTRUNNINGandsomightnotknowwhetheritcanhandlerequests.However,asmentionedabovesomeregistrarssuchasNetflixPranaperformahealthcheckinordertodeterminetheavailabilityoftheserviceinstance.
-
3/3/2015 3rdPartyRegistration
http://microservices.io/patterns/3rdpartyregistration.html 2/2
Unlesstheregistrarispartoftheinfrastructureit'sanothercomponentthatmustbeinstalled,configuredandmaintained.Also,sinceit'sacriticalsystemcomponentitneedstobehighlyavailable.
RelatedpatternsServiceRegistry(serviceregistry.html)ClientSideDiscovery(clientsidediscovery.html)ServerSideDiscovery(serversidediscovery.html)SelfRegistration(selfregistration.html)isanalternativesolution
Tweet 0 Follow@MicroSvcArch Copyright2014ChrisRichardsonAllrightsreserved.