Microservice-Architechture - Best Practices?

Hey there,

I’m fairly new to rancher and I plan on building a mid-sized microservice-architecture with it (~10-15 services, not including dbs, lbs, redis, monitoring).

Now I’m looking for best practices in terms of setup in rancher - i.e. I know how I can make it work (in fact I have it up and running already), but I’d love your input in either: how you do or how it is supposed to be done.

Currently, I have the following setup: Each of our services (say: User Service) has it’s own Stack in Rancher. Each Stack consists of at least the Service and one Load Balancer, also if needed the Database, Redis etc.
Then there is a single Stack for the Environment (Sandbox, Staging, Production) which contains a single Load Balancer that exposes every public service via Port 80. Then there is an Amazon ELB that would do SSL Termination, but that is out of scope right now.

My questions are:

  • Do you have any improvements to this setup? It seems rather clunky to me, but it was the only way for me to easily account for automated deployments per Service
  • Seeing that the HAProxy can happily load balance between several containers on it’s own, do I actually need a separate LB per Service? My guess is that right now I would not loose anything, as the “central” HAProxy would do round-robin per Service-Container and there would be no need for the extra step - am I missing anything?
  • Is anyone using the catalog feature for Continous Deployment? I was thinking of creating a catalog that consists of every service we built so that we can actually do “updates” in the UI instead of using the API, but I’m not quite sure if the overheard (building and maintaining the catalog) is worth it - any thoughts on that?
  • Would this be something you would discuss in your blog? Rancher is one of the greatest tools out there to build micro service architectures (including but certainly not limited to: on a budget) - but I can’t find any “hey look we built it with rancher” posts out there specifically regarding micro services - am I looking in the wrong direction?

Thanks in advance for any replies, I didn’t think the post would get that long so sorry for all that text :slightly_smiling:
Oh, last but certainly not least: keep on the great work rancher team!

Best regards,
Fabian

1 Like

Hi,
Your post is a little bit old, but I’d like to know if you continue using rancher today and if you modified your architecture?
I’am asking the same question about best practices in microservices context.

As you, we choose to have an environment per Dev, Staging and Prod infrastructure. We deploy Stacks that are composed by at least one microservice. According to our need we directedly expose this microservice through a public port or we use a rancher loadbalancer.

On each host we have pre-installed registrator and consul-agent and we have an external HAProxy whose configuration is updated by Consul-Template.

The main question I’am asking to myself is : Is it a best practice to have Dev, Staging and Prod environment? Or wiil it be better to have an environment per business unit (frontend, backend, middle …) with hosts tagged with “Dev”,“staging” and “Prod” …

1 Like