-
Notifications
You must be signed in to change notification settings - Fork 3
Infrastructure Services
As you have just seen the Swisit architecture has composed of multiple microservice.Now imagine what it will look for a client to interact with all these services to complete a business process.(Slide 1)
As you can see the client have multiple interaction points.These will keep on increasing as more services gets added and finally the whole system become unmanagable. (Slide 2 )
API Gateway is a server that is the single entry point into the system.Our gateway is responsible for request routing.All request from the clients first go through the API Gateway.It then routes requests to the appropriate microservice.
It have other responsibilities such as authentication, monitoring, load balancing, caching,request shaping and management.
We are using Netflix Zuul API Gateway that is capable of handling billions of request per day.(Slide 3)
Ok how ? what happens if we want to scale service instances with increase in load?By using the API Gateway,we now can have a cluster of running service instance with a ribbon load balancer which is managing and distributing the load between them.
One of the standard problems with Microservices Architecture is the issue of service discovery.In traditional load balancers which work with servers with well known IP addresses and host names.It is very complicated to specify IP addresses and host name in every MicroServices.So,AWS cloud introduce Netflix’s Eureka is an implementation of a discovery server and integration is provided by Spring Boot.
Eureka is a REST (Representational State Transfer) based service in the AWS cloud for locating services for the purpose of load balancing.Load balancing requires much more sophistication in registering and de-registering servers with load balancer on the fly.
Eureka Server: a server where microservices can register themselves so others can discover them.Enable[@EnableEurekaServer]
Eureka Client : It can be a microservice that is ready to work so it registers itself to the Eureka server. That goes to the server and asks for directions to a specific microservice. Enable [@EnableEurekaClient]
Eureka Instance : A single instance of a microservice (you can add more instances of the same microservice as your load grows i.e. horizontal scaling).