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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:02:58+00:00 2026-05-17T00:02:58+00:00

How scalable is memcache in an enviornment where a cache is potentially getting expired

  • 0

How scalable is memcache in an enviornment where a cache is potentially getting expired every second. In fact, my question is not just about scalability of memcached but about situations where a model is continuously changing and the best way to scale that type of environment. One might say, why cache if the cache is getting expired every second.

Consider this in an hypothetical app, where people are posting marking posts as favorites and let’s just consider that there are thousands of people constantly marking posts favorite and creating a favorite record as a result. With each insertion the post view needs to be updated to show the current stats about posts, how many people made it favorite, a user’s favorite count etc etc.

We were thinking this could be cached to show only a snapshot taken every x many minutes..but is there a good way to make this more real time in rails?

  • 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-17T00:02:59+00:00Added an answer on May 17, 2026 at 12:02 am

    Try such algo:

    1. Update db records for post with +1 vote
    2. Create cache value || update existing cache +1 for post fav count
    3. Create cache value || update existing cache +1 for user fav count

    Because cache has no transactions values may be not consistent with current DB values –
    rare parallel read and write race condition may occur. But these inconsistencies will expire as soon cache entry invalidates and values are recalculated from DB.

    In above scenario cache sweeping operation may be performed every minute or even every hour – depending how accurate stats should be. Remember that you don’t lose anything – all accurate data is kept in DB.

    Most important here is that users see realtime value change for vote.
    Memcached read/write cost is definitely less than DB here because memcache is just multi-access hash store with no transactions.

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

Sidebar

Related Questions

Hi I have a question about scalable div. I know we could do something
Is there any scalable Win32 API (like IOCP not like select) that gives you
I've heard about highly scalable key-value databases, like Amazon DynamoDB and Kyoto Cabinet .
I know a fair about about how amazingly scalable MongoDB is, particularly with its
I am getting to the last stage of my rope (a more scalable version
I posted a similar question on how scalable linq is. There were so many
I'm thinking about using Google Drive as a scalable cloud based data storage solution
is there a scalable email service where you only pay for the emails that
What is a scalable way to select latest 10 items from each category. I
I am looking for scalable way to do the following: User login Fetch all

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.