Design a notification system that queues notifications for background delivery and serves each user's recent notifications from a cache.
Design a backend that delivers notifications to users and lets them read their recent ones. This design brings together the two ideas met separately earlier, a background queue and a read cache, in a single system, as a bridge from the easy tier toward the medium questions that combine many components.
When something happens that should notify a user, the application server puts a delivery job on a queue and responds immediately; worker servers drain the queue and deliver. Separately, when a user opens their notification feed, their recent notifications are served from a cache so the read is fast, falling back to the database on a miss. Build on the basic web-app shape and add both a queue on the write path and a cache on the read path.
Lay out the architecture, then document the API and the trade-offs of combining asynchronous delivery with cached reads.