architecture – Design Apache-Kafka Scenario
I have the following scenario:
I am using Apache-Kafka for developing my application of paying and administrating taxes.
I have a main use-case that I consider will need an implementation via Apache Kafka.
The main actors are: my app, some institutions.
Case 1:
My app is the producer. I have a topic called Users in my Broker. My app will write in this topic new “messages” as new customers decide to make accounts in my app. My app is collaborating with some institutions, so that my app will inform each of them about the new users. Therefore I consider the institutions as consumers. My app needs to inform the institutions about all my users, so that after that, each institution will inform me if and what taxes each of my users have to pay to them.
I considered 2 ways of designing this case:
- Each institution will be a different consumer group which will have one consumer inside.
- Each institution will be a different consumer, but all will be inside the same consumer group.
I understood that for the first way I will need to have more partitions in my topic, and for the second way the problem of high concurrency may appear.
Obs: As new institutions decide to join my app and collaborate with my app, they will be added as new consumers inside the Kafka system.
enter image description here
This is for the first way
enter image description here
This is for the second way
Any suggestion or advice is welcomed 🙂
………………………………..
Read more here: Source link
