A repository where I put all my thoughts about a possible architecture that uses:
- nodejs
- AWS
- microservices
- go server
Nodejs servers should each run a single instance of a microservice, a microservice is intended as a git repo and is generally a server listening on a specific port, exposing REST endpoints that let the user query its domain, data is queried from a dynamodb instance.
From now on I will use the term microservice intending a single nodejs server that runs the right amount of code needed for a single task.
A Go server instance is taking care of the deployment phase, which contains
- testing
- tagging - so that we can fetch the latest version when a new microservice is coming up, where version is just the value of the special variable
$GO_PIPELINE_LABEL - deploying - where we
scpthe code to the microservice
An HAProxy instance (two in reality but let's keep it simple) is routing traffic to the microservices.
All microservices are managed by a CloudFormation script and are hosted on EC2 instances.
HAProxy configuration needs to be updated each time a new microservice gets added or removed to the pool. We managed to have this setup in place without losing requests but as it is now it's cumbersome and could not be easily replicated in a small amount of time.
We have two distinct ways of getting the code on the microservice
- by pushing it during a deploy
- by fetching it when a new server comes up
This probably leads to duplication and unneeded complexity, we might want to have this as one process. Also there's the Go server configuration that has to be done each time for a new deploy process.
There seems to be the need for a new service that orchestrates the message passing to the services, so that for example one single request gets routed to the correct endpoints.
Each time it has to be created and monitored for exceeded throughput.
Code that needs to be there so for example authentication, basic routes like /status and /version and database interaction custom code.
See "Getting the code" above, each new microservice need a new cloudformation script.