Activity tracking
The original use case for Kafka, as it was designed at LinkedIn, is that of user activity
tracking. A website’s users interact with frontend applications, which generate messages
regarding actions the user is taking. This can be passive information, such as
page views and click tracking, or it can be more complex actions, such as information
that a user adds to their profile. The messages are published to one or more topics,
which are then consumed by applications on the backend. These applications may be
generating reports, feeding machine learning systems, updating search results, or performing
other operations that are necessary to provide a rich user experience.
Messaging
Kafka is also used for messaging, where applications need to send notifications (such
as emails) to users. Those applications can produce messages without needing to be
concerned about formatting or how the messages will actually be sent. A single application
can then read all the messages to be sent and handle them consistently,
including:
• Formatting the messages (also known as decorating) using a common look and
feel
• Collecting multiple messages into a single notification to be sent
• Applying a user’s preferences for how they want to receive messages Using a single application for this avoids the need to duplicate functionality in multiple
applications, as well as allows operations like aggregation which would not otherwise be possible