Paths/Backend Engineer/Queues & Async Work / Queue & Consumer Design
Design the Topic Layout
Topics are contracts with your own future self. Write the layout for the order events, with the key that keeps them ordered.
Validator
IDLE — checks run live as you type commands; submit when done
01Requirements
live checks- Directory ~/backend/queues exists○
- File ~/backend/queues/topics.yaml exists○
- The config names the topics, their partitions and their retention○
- The config states the key of every topic○
02Walkthrough
3 steps- 01
Write the topic layout
One topic per event type. The key decides which partition the message lands in, and therefore the order you get.
echo 'topics:\n - name: order.created\n partitions: 12\n key: order_id\n retention: 7d\n - name: payment.captured\n partitions: 12\n key: order_id\n retention: 30d' > ~/backend/queues/topics.yaml - 02
Verify the layout
cat prints the layout. Check that the key is the same on every related topic.
cat ~/backend/queues/topics.yaml - 03
Submit for validation
The validator checks the topics, partitions, retention and key.
03Stuck?
0 of 3 revealedTake a hint without losing the lab — each one points at the thing to look at, not at the answer.
04AI Tutor
guides, never solvesTell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?
04Notebook
saved locally in this browserlearner@lab — ubuntu:24.04
Session is disposable
↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list