Practice
Solution
Step 1: Identify Kafka's role in event sourcing
Kafka supports high throughput with partitioning by aggregate ID, ensuring ordered event processing per aggregate.Step 2: Evaluate other options
Redis pub/sub lacks durability guarantees; relational DB triggers don't scale to 1M events/sec; RabbitMQ's round-robin breaks ordering per aggregate.Final Answer:
Option B -> Option BQuick Check:
Kafka partitions by aggregate ID -> ordered, durable event stream [check]
Solution
Step 1: Identify consistency and latency requirements
Strong consistency requires synchronous replication; low latency demands minimal delay.Step 2: Evaluate architecture options
Single primary DB with sync replication ensures consistency but may increase latency slightly; best trade-off.Final Answer:
Option B -> Option BQuick Check:
Synchronous replication balances strong consistency and latency [check]
Solution
Step 1: Identify lock service role in reservation flow
The lock service ensures exclusive access to room inventory during reservation to prevent double booking.Step 2: Trace failure impact
Without the lock service, Inventory cannot reliably mark rooms as unavailable, leading to stale or incorrect availability states shown to users (Inventory service marks rooms as available incorrectly, causing UI to show wrong availability). Reservations may still proceed but with inconsistent inventory state. Blocking indefinitely (Reservation requests block indefinitely waiting for locks, causing user timeouts and failed bookings) is unlikely as fallback mechanisms exist. Payment processing (Payment processing fails because it depends on the lock service for transaction ordering) is independent of locking. Double bookings (Reservations proceed normally but double bookings increase due to lack of coordination) may increase but the immediate failure is incorrect inventory state.Final Answer:
Option C -> Option CQuick Check:
Lock service failure causes stale inventory availability state [check]
Solution
Step 1: Understand Kafka's role
Kafka buffers RTMP packets to ensure ordered, durable delivery to the transcoder.Step 2: Trace failure impact
If Kafka loses messages, the transcoder stalls (A) due to missing packets, causing segment gaps. CDN (B) serves only what it has, so stale segments appear. RTMP ingest server (C) does not retry lost packets automatically; loss is permanent. Player (D) cannot switch streams without explicit failover.Final Answer:
Option B -> Option BQuick Check:
Kafka loss causes permanent packet loss; RTMP ingest lacks automatic retry [check]
Solution
Step 1: Understand idempotency store role in retries
Without the store, the API cannot verify if a request is a retry, so it must delay processing to avoid duplicates.Step 2: Eliminate other options
Rejecting all requests is possible but not typical; processing retries as new causes duplicates, which is avoided; fallback caches are uncommon and inconsistent.Final Answer:
Option B -> Option BQuick Check:
Unavailable idempotency store causes request queuing to prevent duplicates [check]
