Assume the database has tables for Users, Feeds, Items, and an ability to know which Items the user has already seen. I am looking for a design paradigm that can be used on the server to compute in a short amount of time [feed id, num_unread] for each feed that the user has subscribed to.
Assume plenty of users and that the feeds are getting updated periodically in the backend.
Edit: I wanted to solve the problem Nick J has brought up (see below). But I appreciate the solution posted by cletus. I am not so worried about the db queries, but want a "design paradigm" -- like keeping a watchdog process that keeps the unread counts in memory so that it can be served at any point.