N
Neon11mo ago
narrow-beige

How to efficiently enforce daily notification limits for users in a high-volume notification system?

I'm building a notification service where users have a daily limit on the number of notifications they can receive (e.g., 50 notifications/day). Currently, I check the daily limit in the database every time a notification is sent. However, with high notification volumes, this approach adds significant overhead. I’m considering using Redis for caching limits and counts, but I’m not sure about the best practices for: 1. Storing and incrementing notification counts in Redis. 2. Handling race conditions or atomic updates when multiple notifications are processed concurrently. 3. Syncing Redis counts back to the database to maintain long-term records. Is Redis the right approach, or are there better alternatives for this use case? Any tips or examples would be appreciated!
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?