advancedTop 30 Scenario-Based Questions
How would you implement pub/sub with Redis for real-time notifications?
Redis Pub/Sub for real-time: 1) Publisher (when order status changes): PUBLISH order-updates '{orderId:1001, status:SHIPPED, userId:42}'. 2) Subscriber (notification service): SUBSCRIBE order-updates (receives all messages on channel). 3) Pattern subscribe: PSUBSCRIBE order-* (all order channels). 4) Spring Boot: @Bean RedisMessageListenerContainer + MessageListenerAdapter. @Component with handleM
This is a Pro chapter
Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.
How would you implement pub/sub with Redis for real-time notifications?