Bird
0
0

Which design best supports scalable, multi-user delivery?

hard📝 component behavior Q8 of 15
Django - Celery and Background Tasks
You are building a Django app with Redis as a message broker to deliver real-time notifications to multiple users subscribed to different channels. Which design best supports scalable, multi-user delivery?
AUse Redis as a cache only and send notifications via email
BStore notifications in Redis lists and poll them periodically from the client
CSend notifications directly from Django views without using Redis
DUse Redis Pub/Sub with separate channels per user and a WebSocket consumer subscribing to each user's channel
Step-by-Step Solution
Solution:
  1. Step 1: Understand Redis Pub/Sub

    Redis Pub/Sub supports multiple channels and subscribers efficiently.
  2. Step 2: Match design to real-time multi-user needs

    Using separate channels per user with WebSocket consumers allows targeted, real-time delivery.
  3. Step 3: Evaluate other options

    Polling is inefficient; direct sends lack scalability; email is not real-time.
  4. Final Answer:

    Use Redis Pub/Sub with separate channels per user and a WebSocket consumer subscribing to each user's channel -> Option D
  5. Quick Check:

    Pub/Sub with WebSockets enables scalable real-time notifications [OK]
Quick Trick: Use Redis Pub/Sub with WebSockets for real-time multi-user notifications [OK]
Common Mistakes:
MISTAKES
  • Using polling instead of push notifications
  • Ignoring WebSocket integration for real-time updates
  • Sending notifications without message broker
  • Confusing caching with messaging

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes