I think about architecture pattern, when each client of my service has own kafka consumer.
For example, there is events
topic with some replica factor and some number of partitions, which I used for scalability. All events for given client belongs to one partition (I use clientId
for partition key).
Each client has own offset
. So my API allows to use offset
to get client events.
Is it system design fine? Or what is the right API design to get events?
each client has unique offset.
each message in kafka will have offset, what do you mean byclient
here? According to this(I use clientId for partition key).
same client events will got to same partition? what if you have 1000 clients with 100 partitions topic? – Deadpool