Microservices Architecture
Here is a microservice architecture deployment diagram. All Services are docker containers which are registered to Consul Server via Registrator. Client (External – Mobile, UI) makes a call to Bouncer which is our API Proxy. Bouncer has all permissions configured on API URLs. It makes a call to Auth Server which authenticates the request and if successful it passes the Service URL to HAProxy. HAProxy then has rules configured which redirect the URL to exact service.
Service always follow a naming convention so when service is registered in consul then consul-template refreshes the HAProxy configuration in the background.
Bouncer - API Proxy gateway...all calls come to bouncer to make sure that only authenticated requests are passed to actual services
Auth Server - Single point of authentication and authorization. All applications create permissions and save in Auth Server
External ELB - All public APIs talk to External ELB which in turn are passed to HA Proxy cluster
Internal ELB - All internal APIs are routed through Internal ELBs. There will be URLs which will only be exposed to Internal Services
HA Proxy (Cluster) - The Load balancer cum service router
Consul Server (Cluster) - Centralized Service Registry
Registrator - SideCar application running with each service which updates Consul Cluster about service health
Consul Template - Background application which updates HAProxy whenever there is a change in service configurations
ECS Cluster - AWS ECS where all docker containers are registered. Takes care of dynamically launching new docker containers based on parameters. Autoscaling is handled automatically
There you have major parts in deployment..Happy Coding !!
Though a very nice architecture, but most parts of micro services architecture will be hidden by ECS would like to see how things works inside ECS. Also if we are using ECS do we really need consul?