Kafka considerations

I am developer/code-reviewer/debugger/bug-fixer/architect/teacher/builder from dubai, uae
Search for a command to run...

I am developer/code-reviewer/debugger/bug-fixer/architect/teacher/builder from dubai, uae
No comments yet. Be the first to comment.
Isolation is part of a database's ACID guarantees. It ensures that concurrent transactions don't affect each other. The goal is to maintain the state of the data as if transactions are run serially. H

You Should Tell Yourself

A URL shortener is a proxy service that provides a mapping between the short and full representation of a URL. The short URL has the advantage of being small. The service can also provide useful analy

Listening to the Mel Robbins's podcast on regrets was a 'ear'-opener. One can have reqrets of action or inaction. 4 types of reqrets foundation - should've done the work boldness - should've taken t

We need to create a unique ID generator for our high-traffic web application, generating about 10K IDs/second. The IDs can't simply be monotonically increasing integers, which are good for data access
When consumers are configured with auto-commit, the queue offset will commit on message delivery. If the process dies before processing, the message is effectively lost.
When manually committing messages which is done after processing occurs, if the process dies before committing, the message will be reprocessed by another consumer as the offset isn’t updated.
Kafka consumers are run in a long running processes or maybe as a cronjob. The process connects to the configured cluster, topic and group. On exit, you need to explicitly close the connection. If not the topic/group will enter a rebalancing state where no messages can be read by existing consumers causing a delay in processing or even message loss.
When a consumer enters/leaves a group, dies or partitions are reassigned.
It will load balance non overlapping messages across consumers, automatically assigns partitions and manage offsets. However there is chance of reprocessing of messages during rebalancing.
Can be configured at the server level, but drastically reduces throughput.
Duplicate messages will be the norm. Use the strategies below to avoid reprocessing messages.
Unique constraints on application tables
Unique constraints on separate message table
Use the outbox pattern when adding to the DB + producing a message
Redis deduplication with NX
Produce Application level messages with a unique ID
This bypasses coordination across consumer group of a topic. The application has to manage conflicts.
You can specify a unique group_instance_id of each instance to avoid rebalancing and its effects. Can be managed via k8s.