Learn vocabulary for log-based architecture, immutable event logs, Kafka log compaction, consumer group lag, offset management, and replay semantics.
0 / 30 completed
1 / 30
What is a 'log-based architecture' in streaming vocabulary?
Log-based architecture (Martin Kleppmann, 'Designing Data-Intensive Applications'): the log is the system of record. Kafka topics are durable, ordered, append-only logs. Services publish facts ('OrderPlaced', 'PaymentProcessed') to the log; consumers derive views (databases, caches, search indexes) by reading and processing the log. The log becomes the integration backbone — any consumer can replay from offset 0 to rebuild state.
2 / 30
What is 'log compaction' in Kafka vocabulary?
Log compaction vs. time-based retention: time-based retention deletes old messages after N days (suitable for event streams). Log compaction keeps the latest record per key indefinitely (suitable for changelog topics — e.g., a KTable changelog). After compaction, the log still contains all current values but not the full history per key. Kafka Streams uses compacted changelog topics to restore local state stores after failures.
3 / 30
What is 'consumer group lag' in Kafka vocabulary?
Consumer group lag (also called consumer lag): if the topic's latest offset is 10,000 and a consumer group's committed offset is 9,500, the lag is 500 messages. High lag indicates consumers can't keep up with producers — a sign of processing bottleneck or consumer failure. Monitor lag with kafka-consumer-groups --describe or tools like Burrow, Cruise Control, or Confluent Control Center. Lag is a key operational metric.
4 / 30
What is 'offset management' in Kafka consumer vocabulary?
Kafka offsets: each message in a partition has a sequential offset number. Consumers commit their current offset to Kafka (internal __consumer_offsets topic) to record progress. Auto-commit (enable.auto.commit=true): simple but risks duplicates on crash. Manual commit: commit only after successful processing (at-least-once). Commit before processing (at-most-once). Exactly-once: use transactions + idempotent consumers.
5 / 30
What is 'replay semantics' in event sourcing and streaming vocabulary?
Replay is a superpower of log-based architectures: because Kafka retains events (by time or log compaction), any consumer can rewind to offset 0 and replay the entire history. Use cases: (1) Deploy a new service that needs historical data — replay from the beginning. (2) Fix a bug in a consumer — replay to correct derived state. (3) Build a new read model (search index, cache) — populate from the log. Replay makes the event log the single source of truth.
6 / 30
Alice (Senior Developer) comments on a PR:
"I'm seeing some odd behavior with the user event processing. The system seems to be repeatedly attempting to update the order status even after it's been successfully marked as 'shipped'. It's like the stream isn't fully reflecting the latest state. Could we investigate if we're correctly handling duplicate events here?"
Replay semantics dictate that a consumer can reprocess events from its historical stream multiple times. This is crucial for event sourcing systems where new information might necessitate reprocessing older data. The question highlights the potential issue of duplicate events, directly relating to how consumers handle these replayed streams – option A and D are incorrect because they describe resilience or expected asynchronous behavior, not the core concept of replay.
7 / 30
During a standup meeting, Ben (Team Lead) says: "We're monitoring consumer group lag closely. It's currently at 15 minutes – significantly higher than our target of 5. This suggests we need to increase the number of consumers in the Kafka cluster."
Consumer group lag is the critical measurement here. It accurately represents the time difference between an event's arrival in the Kafka stream and when a consumer has fully processed it. Option A is incorrect because simply adding more consumers doesn't guarantee reduced lag – it depends on the processing capacity of each consumer. Option D misinterprets the meaning of lag.
8 / 30
You receive the following API response from our event sourcing platform:
HTTP/1.1 200 OKContent-Type: application/json{
"event_id": "order_updated_123",
"timestamp": "2024-10-27T10:00:00Z",
"user_id": 456,
"operation": "update_status",
"old_value": {"status":"pending"},
"new_value": {"status":"shipped"}
}
What does the `event_id` field primarily represent in an event sourcing context?
The `event_id` is fundamental to *replay semantics*. It's a guaranteed, immutable identifier that allows consumers to precisely locate and reprocess an event from its historical stream. Options A and D are incorrect as they relate to the API request or timestamp respectively; option B is misleading – order within streams can be complex and not solely determined by this ID.
9 / 30
Charlie (Data Engineer) sends a Slack message:
"We're considering implementing log compaction in Kafka to reduce storage costs. I've read that it involves deleting older events after they've been compacted into a single, more efficient record."
Log compaction's primary function is to reduce storage costs by consolidating multiple events sharing the same key into a single record. This is achieved by deleting older records after they've been compacted. Option A is incorrect because it describes a limitation of replay semantics; option D is an inaccurate statement about its use cases.
10 / 30
In a PR description for a new feature that uses event sourcing:
'This change introduces the ability to update user order statuses in real-time. The system publishes an OrderShippedEvent to the Kafka stream, and consumers process this event to immediately reflect the shipment status on the user's dashboard.'
Replay semantics become crucial here because the system acknowledges that consumers *could* potentially process the same `OrderShippedEvent` multiple times. Graceful handling of duplicates is essential for ensuring data consistency and preventing unintended side effects. Option A describes autoscaling – not a core component of replay semantics; option B misrepresents its importance, and D incorrectly equates idempotency with replay.
11 / 30
Alice (Senior Developer) comments on a PR:
"I'm seeing some odd behavior with the user event processing. The system seems to be repeatedly attempting to update the order status even after it's been successfully marked as 'shipped'. It's like the stream isn't fully reflecting the latest state. Could we investigate if we're correctly handling duplicate events here?"
Replay semantics dictate that a consumer can reprocess events from its historical stream multiple times. This is crucial for event sourcing systems where new information might necessitate reprocessing older data. The question highlights the potential issue of duplicate events, directly relating to how consumers handle these replayed streams – option A and D are incorrect because they describe resilience or expected asynchronous behavior, not the core concept of replay.
12 / 30
During a standup meeting, Ben (Team Lead) says: "We're monitoring consumer group lag closely. It's currently at 15 minutes – significantly higher than our target of 5. This suggests we need to increase the number of consumers in the Kafka cluster."
Consumer group lag is the critical measurement here. It accurately represents the time difference between an event's arrival in the Kafka stream and when a consumer has fully processed it. Option A is incorrect because simply adding more consumers doesn't guarantee reduced lag – it depends on the processing capacity of each consumer. Option D misinterprets the meaning of lag.
13 / 30
You receive the following API response from our event sourcing platform:
HTTP/1.1 200 OKContent-Type: application/json{
"event_id": "order_updated_123",
"timestamp": "2024-10-27T10:00:00Z",
"user_id": 456,
"operation": "update_status",
"old_value": {"status":"pending"},
"new_value": {"status":"shipped"}
}
What does the `event_id` field primarily represent in an event sourcing context?
The `event_id` is fundamental to *replay semantics*. It's a guaranteed, immutable identifier that allows consumers to precisely locate and reprocess an event from its historical stream. Options A and D are incorrect as they relate to the API request or timestamp respectively; option B is misleading – order within streams can be complex and not solely determined by this ID.
14 / 30
Charlie (Data Engineer) sends a Slack message:
"We're considering implementing log compaction in Kafka to reduce storage costs. I've read that it involves deleting older events after they've been compacted into a single, more efficient record."
Log compaction's primary function is to reduce storage costs by consolidating multiple events sharing the same key into a single record. This is achieved by deleting older records after they've been compacted. Option A is incorrect because it describes a limitation of replay semantics; option D is an inaccurate statement about its use cases.
15 / 30
In a PR description for a new feature that uses event sourcing:
'This change introduces the ability to update user order statuses in real-time. The system publishes an OrderShippedEvent to the Kafka stream, and consumers process this event to immediately reflect the shipment status on the user's dashboard.'
Replay semantics become crucial here because the system acknowledges that consumers *could* potentially process the same `OrderShippedEvent` multiple times. Graceful handling of duplicates is essential for ensuring data consistency and preventing unintended side effects. Option A describes autoscaling – not a core component of replay semantics; option B misrepresents its importance, and D incorrectly equates idempotency with replay.
16 / 30
Alice (Senior Developer) comments on a PR:
"I'm seeing some odd behavior with the user event processing. The system seems to be repeatedly attempting to update the order status even after it's been successfully marked as 'shipped'. It's like the stream isn't fully reflecting the latest state. Could we investigate if we're correctly handling duplicate events here?"
Replay semantics dictate that a consumer can reprocess events from its historical stream multiple times. This is crucial for event sourcing systems where new information might necessitate reprocessing older data. The question highlights the potential issue of duplicate events, directly relating to how consumers handle these replayed streams – option A and D are incorrect because they describe resilience or expected asynchronous behavior, not the core concept of replay.
17 / 30
During a standup meeting, Ben (Team Lead) says: "We're monitoring consumer group lag closely. It's currently at 15 minutes – significantly higher than our target of 5. This suggests we need to increase the number of consumers in the Kafka cluster."
Consumer group lag is the critical measurement here. It accurately represents the time difference between an event's arrival in the Kafka stream and when a consumer has fully processed it. Option A is incorrect because simply adding more consumers doesn't guarantee reduced lag – it depends on the processing capacity of each consumer. Option D misinterprets the meaning of lag.
18 / 30
You receive the following API response from our event sourcing platform:
HTTP/1.1 200 OKContent-Type: application/json{
"event_id": "order_updated_123",
"timestamp": "2024-10-27T10:00:00Z",
"user_id": 456,
"operation": "update_status",
"old_value": {"status":"pending"},
"new_value": {"status":"shipped"}
}
What does the `event_id` field primarily represent in an event sourcing context?
The `event_id` is fundamental to *replay semantics*. It's a guaranteed, immutable identifier that allows consumers to precisely locate and reprocess an event from its historical stream. Options A and D are incorrect as they relate to the API request or timestamp respectively; option B is misleading – order within streams can be complex and not solely determined by this ID.
19 / 30
Charlie (Data Engineer) sends a Slack message:
"We're considering implementing log compaction in Kafka to reduce storage costs. I've read that it involves deleting older events after they've been compacted into a single, more efficient record."
Log compaction's primary function is to reduce storage costs by consolidating multiple events sharing the same key into a single record. This is achieved by deleting older records after they've been compacted. Option A is incorrect because it describes a limitation of replay semantics; option D is an inaccurate statement about its use cases.
20 / 30
In a PR description for a new feature that uses event sourcing:
'This change introduces the ability to update user order statuses in real-time. The system publishes an OrderShippedEvent to the Kafka stream, and consumers process this event to immediately reflect the shipment status on the user's dashboard.'
Replay semantics become crucial here because the system acknowledges that consumers *could* potentially process the same `OrderShippedEvent` multiple times. Graceful handling of duplicates is essential for ensuring data consistency and preventing unintended side effects. Option A describes autoscaling – not a core component of replay semantics; option B misrepresents its importance, and D incorrectly equates idempotency with replay.
21 / 30
Alice (Senior Developer) comments on a PR:
"I'm seeing some odd behavior with the user event processing. The system seems to be repeatedly attempting to update the order status even after it's been successfully marked as 'shipped'. It's like the stream isn't fully reflecting the latest state. Could we investigate if we're correctly handling duplicate events here?"
Replay semantics dictate that a consumer can reprocess events from its historical stream multiple times. This is crucial for event sourcing systems where new information might necessitate reprocessing older data. The question highlights the potential issue of duplicate events, directly relating to how consumers handle these replayed streams – option A and D are incorrect because they describe resilience or expected asynchronous behavior, not the core concept of replay.
22 / 30
During a standup meeting, Ben (Team Lead) says: "We're monitoring consumer group lag closely. It's currently at 15 minutes – significantly higher than our target of 5. This suggests we need to increase the number of consumers in the Kafka cluster."
Consumer group lag is the critical measurement here. It accurately represents the time difference between an event's arrival in the Kafka stream and when a consumer has fully processed it. Option A is incorrect because simply adding more consumers doesn't guarantee reduced lag – it depends on the processing capacity of each consumer. Option D misinterprets the meaning of lag.
23 / 30
You receive the following API response from our event sourcing platform:
HTTP/1.1 200 OKContent-Type: application/json{
"event_id": "order_updated_123",
"timestamp": "2024-10-27T10:00:00Z",
"user_id": 456,
"operation": "update_status",
"old_value": {"status":"pending"},
"new_value": {"status":"shipped"}
}
What does the `event_id` field primarily represent in an event sourcing context?
The `event_id` is fundamental to *replay semantics*. It's a guaranteed, immutable identifier that allows consumers to precisely locate and reprocess an event from its historical stream. Options A and D are incorrect as they relate to the API request or timestamp respectively; option B is misleading – order within streams can be complex and not solely determined by this ID.
24 / 30
Charlie (Data Engineer) sends a Slack message:
"We're considering implementing log compaction in Kafka to reduce storage costs. I've read that it involves deleting older events after they've been compacted into a single, more efficient record."
Log compaction's primary function is to reduce storage costs by consolidating multiple events sharing the same key into a single record. This is achieved by deleting older records after they've been compacted. Option A is incorrect because it describes a limitation of replay semantics; option D is an inaccurate statement about its use cases.
25 / 30
In a PR description for a new feature that uses event sourcing:
'This change introduces the ability to update user order statuses in real-time. The system publishes an OrderShippedEvent to the Kafka stream, and consumers process this event to immediately reflect the shipment status on the user's dashboard.'
Replay semantics become crucial here because the system acknowledges that consumers *could* potentially process the same `OrderShippedEvent` multiple times. Graceful handling of duplicates is essential for ensuring data consistency and preventing unintended side effects. Option A describes autoscaling – not a core component of replay semantics; option B misrepresents its importance, and D incorrectly equates idempotency with replay.
26 / 30
Alice (Senior Developer) comments on a PR:
"I'm seeing some odd behavior with the user event processing. The system seems to be repeatedly attempting to update the order status even after it's been successfully marked as 'shipped'. It's like the stream isn't fully reflecting the latest state. Could we investigate if we're correctly handling duplicate events here?"
Replay semantics dictate that a consumer can reprocess events from its historical stream multiple times. This is crucial for event sourcing systems where new information might necessitate reprocessing older data. The question highlights the potential issue of duplicate events, directly relating to how consumers handle these replayed streams – option A and D are incorrect because they describe resilience or expected asynchronous behavior, not the core concept of replay.
27 / 30
During a standup meeting, Ben (Team Lead) says: "We're monitoring consumer group lag closely. It's currently at 15 minutes – significantly higher than our target of 5. This suggests we need to increase the number of consumers in the Kafka cluster."
Consumer group lag is the critical measurement here. It accurately represents the time difference between an event's arrival in the Kafka stream and when a consumer has fully processed it. Option A is incorrect because simply adding more consumers doesn't guarantee reduced lag – it depends on the processing capacity of each consumer. Option D misinterprets the meaning of lag.
28 / 30
You receive the following API response from our event sourcing platform:
HTTP/1.1 200 OKContent-Type: application/json{
"event_id": "order_updated_123",
"timestamp": "2024-10-27T10:00:00Z",
"user_id": 456,
"operation": "update_status",
"old_value": {"status":"pending"},
"new_value": {"status":"shipped"}
}
What does the `event_id` field primarily represent in an event sourcing context?
The `event_id` is fundamental to *replay semantics*. It's a guaranteed, immutable identifier that allows consumers to precisely locate and reprocess an event from its historical stream. Options A and D are incorrect as they relate to the API request or timestamp respectively; option B is misleading – order within streams can be complex and not solely determined by this ID.
29 / 30
Charlie (Data Engineer) sends a Slack message:
"We're considering implementing log compaction in Kafka to reduce storage costs. I've read that it involves deleting older events after they've been compacted into a single, more efficient record."
Log compaction's primary function is to reduce storage costs by consolidating multiple events sharing the same key into a single record. This is achieved by deleting older records after they've been compacted. Option A is incorrect because it describes a limitation of replay semantics; option D is an inaccurate statement about its use cases.
30 / 30
In a PR description for a new feature that uses event sourcing:
'This change introduces the ability to update user order statuses in real-time. The system publishes an OrderShippedEvent to the Kafka stream, and consumers process this event to immediately reflect the shipment status on the user's dashboard.'
Replay semantics become crucial here because the system acknowledges that consumers *could* potentially process the same `OrderShippedEvent` multiple times. Graceful handling of duplicates is essential for ensuring data consistency and preventing unintended side effects. Option A describes autoscaling – not a core component of replay semantics; option B misrepresents its importance, and D incorrectly equates idempotency with replay.
What will I learn from the "Event Sourcing and Streaming — Vocabulary" exercise?
Learn vocabulary for log-based architecture, immutable event logs, Kafka log compaction, consumer group lag, offset management, and replay semantics.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to use with no account, sign-up, or paywall required.
How many questions are in this exercise?
This set contains 30 multiple-choice questions, each with a detailed explanation shown after you answer.
Do I need to create an account to track my progress?
No account is required. Your progress bar and score reset each time you reload the page, but you can retry the exercise as many times as you like.
Who is this Streaming Data exercise for?
This exercise is built for IT professionals and non-native English speakers who need to read, write, and discuss streaming data topics confidently at work.
What happens if I answer a question incorrectly?
You will see the correct answer highlighted along with a detailed explanation of why it is correct -- so every wrong answer becomes a learning moment, not just a lost point.
Can I retry this exercise?
Yes -- click "Try again" on the results screen at any time to reset your score and go through all the questions again.
How long does this exercise take to complete?
Most learners finish all 30 questions in under 10 minutes, since each question is answered by clicking a single option.
Where can I find more Streaming Data exercises?
See the full Streaming Data exercises hub for more vocabulary drills on this topic.
Is this exercise mobile-friendly?
Yes -- the exercise works on any device with a modern browser, including phones and tablets, with no app download required.