Hesitation between two microservice architectures

Hello, I'm wondering if there is a limit to the number of connections that can be made to the Gateway. Let's say I want to use sharding, I have 20 microservices, and each one needs to be able to listen and send events. Can each microservice create a connection to the Gateway, or is there a limit? I have two architectures in mind. In solution A, a single microservice handles the Gateway connection, but in this case a message broker is required. In solution B, each microservice connects to the Gateway and does not depend on another microservice, however, I guess that in this solution, each microservice will have higher CPU/RAM usage. You can see the schemas of the two solutions in the image. If you have any other important information, it could help me to decide. Thank you.
2 Replies
d.js toolkit
d.js toolkit2y ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
GreenMonkeyBoy
GreenMonkeyBoyOP2y ago
You are right, I had forgotten that a bot could also use the Rest API. I'm gonna use one single microservice and request REST API like you said. Thank you.

Did you find this page helpful?