Software Engineering Asked by JCode on February 8, 2021
Good afternoon,
I’m getting into microservices – in fact, I’ve managed to make few full projects based on that architecture – but they weren’t really robust, so I couldn’t get the full scope of using microservices.
I’m struggling with 2 concepts related to scalability and reliability, and I would appreciate a simple explanation in layman’s terms.
Reliability
Let’s say that I have Docker and utilize it to run 3 instances of the same image (service).
They can’t all be bound to the same port, so the generated ports are usually n+1 (9000, 9001, 9002) – do I have to implement a service discovery that checks whether one of 3 ports is available for usage – or does Docker have something implemented that’ll allow me to define a single port (9000) that’ll redirect traffic to a service instance that is available and has the lowest load?
Scalability
Let’s say that I have 3 different services: Apples, Oranges, and Bananas.
Now, let’s say that Oranges are used the most and need to be scaled by adding a few instances but on a different server.
How does that process work? Do I just create instances on a different server? But then what – how do they get connected to the other services?
Thanks for your time!
One useful pattern is the message broker. Though these were originally created to facilitate communication between applications, a lightweight version of a message broker can be used to ensure reliable message delivery. (For example, you probably aren't interested in the message translation capabilities.)
Such an intermediary may queue messages, and even persist them, which allows individual services to be brought down and back up again. This intermediary can also support a publish/subscribe notion to route messages to interested parties without them having to know about the actual endpoints. An intermediary could do load balancing among copies of services, without other microservices having to know about replication/scalability.
Have a look at Kafka, RabbitMQ, Redis, among others.
Answered by Erik Eidt on February 8, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP