DEV Community

Maxime Guilbert
Maxime Guilbert

Posted on • Updated on

Kafka Architecture : Synchronous to Asynchronous [3]

Today, in this last part we will see the best solution about how you can use Kafka to have communication between synchronous applications and asynchronous applications!


Solution 3 : Modify your architecture to full asynchronous

Wait? What?! You are talking about the best solution to make communicate a synchronous application with an asynchronous one, then you talk to change everything?!

Exactly! As we saw in the two last examples, there's no optimal situation to let communicate a synchronous app with an asynchronous service using kafka.

So a solution to be sure to avoid all these issues is to have a complete asynchronous architecture. By using callbacks for example.


Example

Callback schema

Your consumer must give you a callback URL and then when an instance of the API receive the response, it can answer!


Pros & cons

Pros Cons
Avoid issues Syncho <-> Asynchro Your consumer must support the asynchronous architecture

So it's definitively the solution which will need the most work. But depending your context, it can be the best solution for you.


I hope you like this mini-serie and it helps you. 🍺


You want to support me?

Buy Me A Coffee

Top comments (0)