HACKER Q&A
📣 orsol

What type of communication between microservices you use by default


Here is a diagram to illustrate two commons way of communication https://ibb.co/Ch5Vsdz

Do you use direct communication or message bus by default? Are there any pros or cons that are missing from the diagram?


  👤 sethammons Accepted Answer ✓
I tend to reach for a queue when an item should processed by a single consumer and you have fancy retry logic.

I tend to reach for a message bus when N consumers may need to know about an event that happened.

I usually start with a synchronous API call to the target service over http and only reach for other methods when reliability, response time, or throughput concerns justify it.