Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 253215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:44:35+00:00 2026-05-11T21:44:35+00:00

Assume the database has tables for Users, Feeds, Items, and an ability to know

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:44:35+00:00Added an answer on May 11, 2026 at 9:44 pm

    I’m not sure what to tell you exactly because what you’re asking is reasonably straightforward.

    First off, use Google Reader as a reference for online feed aggregators/readers. And if you’re trying to recreate the functionality, Google Reader has pretty much nailed it already (imho).

    Google Reader works simply by storing a list of feeds. In DB terms, you’d probably have these entities

    User: id, name, email, etc...
    Feed: id, feed_name, feed_url
    Content: id, feed_id, title, content
    User Feed: id, user_id, feed_id, user_label, has_read
    

    Unread items:

    SELECT COUNT(1)
    FROM user u
    JOIN user_feed uf ON uf.user_id = u.id
    JOIN feed f ON f.id = uf.feed_id
    WHERE has_read = 0
    

    Unread items by feed:

    SELECT feed_id, feed_name, COUNT(1)
    FROM user u
    JOIN user_feed uf ON uf.user_id = u.id
    JOIN feed f ON f.id = uf.feed_id
    WHERE has_read = 0
    GROUP BY feed_id, feed_name
    

    And then you just need some mechanism for marking items as read. In Google Reader’s case, there are just AJAX calls triggered by mouseover events with additional links to mark everything as read, leave an item marked as unread and so on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 120k
  • Answers 120k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer change: #main { width: 100%; float: left; position: relative; background:… May 12, 2026 at 12:09 am
  • Editorial Team
    Editorial Team added an answer You may be interested in HtmlUnit which is used by… May 12, 2026 at 12:09 am
  • Editorial Team
    Editorial Team added an answer You may have realized that IE is giving the error… May 12, 2026 at 12:09 am

Related Questions

I'm writing a reasonably complex web application. The Python backend runs an algorithm whose
I just installed Web Developer Express 2008 and the MVC framework (followed all the
In StackOverflow podcast no. 19 , Joe describe Fogcreek's decision to have one database
I'm working on a database design for groups hierarchy used as the foundation of

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.