I’ve read in several places that it’s recommended to keep to the 1 service:1 container practice according to the microservices paradigm. I understand that it allows for separation of concerns, flexibility for scaling and so on. But at the same time I’ve been finding that some people opt to couple two services that will do a lot of communication with each other in one container, because in their mind it reduces complexity. Personally, I’m concerned that deploying services in separate containers creates the potential for increased network latency/an additional network hop if the containers end up on separate nodes in the Swarm. Then again, I have trouble judging whether this is worth worrying about since I’m lacking in expertise.
Can people share where they draw the line when it comes to microservices and what are the considerations you take when deciding? For instance, if you have Python web app, do you separate your wsgi server and Nginx?
Currently I have nginx and my Django backend/GraphQL server coupled together in one container, and my React frontend in another. Since i’m fretting about the network latency, I’ve been wondering if in theory I should try to ensure that each container is deployed alongside the other on the same node, so that each request from the frontend can go directly to the backend on the same node (instead of hopping over to a replica of the backend on another node). Does anyone try to do this, or is it overengineering?
I know I don’t REALLY need to worry about this at this point in my project, but I tend to be preoccupied by what’s considered ‘best practice’ and would like to have a better sense of what that is. Thanks for any input, I appreciate it!