Asynchronous communication in Microservices Interview Questions and Answers | Part -3 | Code Decode

preview_player
Показать описание
Microservice asynchronous communication Interview questions and answers we have covered in this video of code decode

Udemy Course of Code Decode on Microservice k8s AWS CICD link:

Course Description Video :

Ways to communicate between Microservices

We have seen Synchronous communications through -
Rest APIs
GraphQl
Feign using Eureka discoveries
GRPC ( 10 times faster than REST APIs ) - developed by Google as substitute of REST with many more features.

A synchronous call means that a service waits for the response after performing a request.

Today we will look at ways to do asynchronous communication in java. This communication usually involves some kind of messaging system like
Active Mqs
Rabbit MQs
Kafka

What is Async communication

In Async communication , To initiate such type of communication, a Microservice who wants to send some data to another Microservice publishes a message to a separate component known as a message broker. It is responsible for handling the message sent by the producer service and it will guarantee message delivery.

After the message is received by the broker, it’s now its job to pass the message to the target service. If the recipient is down at the moment, the broker might be configured to retry as long as necessary for successful delivery.

These messages can be persisted if required or stored only in memory. In the latter case, they will be lost when the broker is restarted and they are not yet sent to the consumer.

Since the broker is responsible for delivering the message, it’s no longer necessary for both services to be up for successful communication. Thus async messaging mitigates the biggest problem of synchronous communication - coupling.

What is Async communication

In Async communication , To initiate such type of communication, a Microservice who wants to send some data to another Microservice publishes a message to a separate component known as a message broker. It is responsible for handling the message sent by the producer service and it will guarantee message delivery.

After the message is received by the broker, it’s now its job to pass the message to the target service. If the recipient is down at the moment, the broker might be configured to retry as long as necessary for successful delivery.

These messages can be persisted if required or stored only in memory. In the latter case, they will be lost when the broker is restarted and they are not yet sent to the consumer.

Since the broker is responsible for delivering the message, it’s no longer necessary for both services to be up for successful communication. Thus async messaging mitigates the biggest problem of synchronous communication - coupling.

What is Async communication

A relevant point here is that there, the sender doesn't need to wait for the response. It might be sent back from the receiver later as another asynchronous message.

The intended service receives the message in its own time. The sending service is not locked to the broker. It simply fires and forgets.

What if the message broker is down?

A message broker is a vital part of the asynchronous architecture and hence must be fault tolerant

This can be achieved by setting up additional standby replicas that can do failover. Still, even with auxiliary replicas, failures of the messaging system might happen from time to time.

If it’s essential to ensure the message arrives at its destination, a broker might be configured to work in at-least-once mode. After the message reaches the consumer, it needs to send back ACK to the broker. If no acknowledgement gets to the broker, it will retry the delivery after some time.

Subscriber and Follow Code Decode

#annotations #codedecode #springbootinterviewquestions
Рекомендации по теме
Комментарии
Автор

Thanks for uploading this is very frequently ask interview question

tanveersyed
Автор

Yes please make videos on Kafka I heard this in every interview i had and grpc also 10 times faster 🧑‍💻 wanna learn more. Thanks for the video 🧑‍💻

johnnybreathe
Автор

I have watched all 3 parts which are very usefull. This are best content vedios for an interview. Really helpful thnks a tonn

madhumithareddy
Автор

Hats Up. Really ur teaching way is very clear and accurate with the explanations. Great Job . Please post new things in Microservices and Kubernetes. Appreciate u

dhananjaysamal
Автор

I would like to take this opportunity to thank you very much as your content has helped me a lot in getting job in one my dream company. You have explained the concepts in an excellent way. Keep up the good work all the best!!

swaruppal
Автор

I have just watched the second episode of this series and was searching for the other questions you mentioned in the slides but couldn't found since the video never uploaded for them, and BOOM its here .. Thanks for the upload 🎉

trademoneynothealth
Автор

Undoubtedly this is the best explanation for the Async communication between the microservices. Thankyou very much Code Decode team :)

eshantkumargola
Автор

Thank you so much for your valuable time for making such good vedios, tutorials are very nice and to the point . I have watched your complete series and able to understand microservices very easily.

mayurikarjol
Автор

Thank you Dear for your simplistic explanation.

mikedelta
Автор

it's amazing content that i found on internet please upload grpc video as well. Thanks for guiding us.

kanikagoyal
Автор

super explanation. This is the first time I am messaging in comments section.

jajulasiva
Автор

Please prepare implement kafka video ..its really helpful videos which you come up with ..thanks for such knowledgable videos

vidyapurohit
Автор

Hello, great explanation about each and everything in deep. Thank you.

priyanshurastogi
Автор

very crisp and clear information . By heart i m giving this message . No one explains me this well :)

suryapriyamusuwathi
Автор

awesome tutorial. Thanks for coming up with such a nice explanations.

dilipkg
Автор

It's really so helpful the way your explain so clear understanding even in short time, request you to do more videos and POC in this topic, many people will definitely get benefited out of it, much Appreciated for your sincere efforts for making these videos

MrMaheshb
Автор

Thanks for the video. It will be very helpful if you provide a video on kafka and Grpc implementation along with the important concepts about those 2 topics.

learncodingideaswithme
Автор

Your videos are best for theoretical interview questions. Please make videos on both Graph Ql and GRPC. Thanks in advance.

seelamrameshreddy
Автор

Well organised content. Expecting an implementation in vaccination center microservices project. Which makes it more complete.

Please make small POCs on all topics with same usecase.

vengateshm
Автор

Very informative. Thank you for sharing… ❤️❤️❤️

dipaliyadav-koli