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 8903783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:57:21+00:00 2026-06-15T01:57:21+00:00

I have an activity feed system that uses Redis sorted sets. Events happen and

  • 0

I have an activity feed system that uses Redis sorted sets.

Events happen and a message is placed into a sorted set for each relevant user, with a timestamp for the score.

The messages are then distributed to the users, either when they log in, or through a push if the user is currently logged in.

I’d like to differentiate between messages that have been "read" by the user and ones that are still unread.

From my understanding, I can’t just have a "read/unread" property as part of the member as changing it would cause the member to be different and therefore be added a second time, instead of replacing the current member.

So, what I’m thinking is that for each user, I have to sorted sets – an "unread" set and a "read" set.

  • When new events come in, they’re added to the "unread" set
  • When the user reads a message, I add the message to the read set and remove it from the unread set.

A little less sure on how to deliver them. I can’t just union them as I lose the distinction between read/unread unless I inverse the score on the unread ones, for instance.

Returning the two sets individually (and merging them in code) makes paging difficult. I’d like to be able to the 20 most recent messages regardless of read/unread status.

So, questions:

  1. Is the read set/unread set way the best way to do it? Is there a better way?
  2. What’s the best way to return subsets of the merged/union’d data.
  • 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-06-15T01:57:22+00:00Added an answer on June 15, 2026 at 1:57 am

    Instead of trying to update the member, you could just pop it and insert a new version. Should be no problem, because you know both member and its timestamp.

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

Sidebar

Related Questions

I have activity that parses XML feed (with news) and loads parsed data (text
I will have an activity feed per user that displays all activity related to
I have an activity that when users press share on a file it would
I have an Activity A that calls an Activity B using startActivityForResult() . Under
I have an Activity that should only get created once. That is, onCreate can
right to business. I have an activity feed which gets all different kinds of
I have an RSS feed parsed into a list view in my app. I'm
I have a google map set up with markers supplied via a JSON feed.
I'm making an app that uses a video feed. There will be several UI
I have Activity with some data displayed in WebView that I load with WebView#loadDataWithBaseURL

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.