Exercise 3 - Scaling: Mandatory features
Requirements:
- Each instance of the back-end should have its own endpoint/port. For example, you can run your first instance on port 3001, the second one on 3002 and so on. (It is not necessary to add a load balancer.)
- Each back-end instance should run in its own docker container. All back-end instances should use the same docker image. Do not build different images for the different back-ends, but rather configure them differently (by exposing a different port).
- It must be possible to choose the back-end that you connect to. For example, by
opening
localhost:3002
in the browser. - For the user, it should not matter which back-end they connect to. For example, if I connect to “back-end one”, and add a new TODO item, I should see the same TODO item as well in “back-end two”.
- The back-end instances do not need to synchronize in real-time. It is enough if you can reload the page to see an update from the other instance.
- Use the same database (MongoDB) for all the back-end instances. Don’t use multiple instances of the database.