In a Pub/Sub system, what is the correct sequence of events when a message is published?
Think about the natural flow from publisher to broker to consumers.
The publisher first sends the message to the broker. The broker then stores it and forwards it to all subscribed consumers, who finally process the message.
Which component is essential to decouple publishers and subscribers in a scalable Pub/Sub architecture?
Consider what allows asynchronous communication without direct links.
A message broker or event bus acts as an intermediary that decouples publishers and subscribers, enabling scalability and flexibility.
You need to design a Pub/Sub system that handles millions of messages per second. Which approach best supports this scale?
Think about distributing load and avoiding bottlenecks.
Using multiple distributed brokers with partitioned topics allows parallel processing and avoids single points of failure, supporting very high throughput.
Which delivery guarantee in a Pub/Sub system may cause duplicate messages but ensures no message loss?
Consider which guarantee prioritizes message safety over duplicates.
At least once delivery ensures messages are never lost but may deliver duplicates, requiring consumers to handle idempotency.
You expect 10,000 publishers each sending 100 messages per second, and 1,000 subscribers. Each message is 1 KB. What is the minimum network bandwidth in Mbps the broker must support to handle incoming messages?
Calculate total messages per second and multiply by message size, then convert to Mbps.
Total messages per second = 10,000 * 100 = 1,000,000 messages/sec. Each message is 1 KB = 8,000 bits. Total bits per second = 1,000,000 * 8,000 = 8,000,000,000 bits/sec = 8,000 Mbps.