Like Mo mo such product, backstage how to design the cache?? Specific questions big God please click inside, the title is not clear.

Source: Internet
Author: User
We've been working on a similar piece of software with Momo recently. Because the database has not been keeping up with the situation, so have to add cache. But there is a doubt here.
For a general app, what everyone sees is the same, so it's good to put that data directly into the cache. But for example, Mo mo. People nearby are not the same people that everyone sees nearby. Each person sees different data, how do I load the cache? Or do you have a different, as long as the user wants to see, the data loaded into the cache it? In general, people like Momo, if you are to design a caching strategy, how do you design?????????

Reply content:

We've been working on a similar piece of software with Momo recently. Because the database has not been keeping up with the situation, so have to add cache. But there is a doubt here.
For a general app, what everyone sees is the same, so it's good to put that data directly into the cache. But for example, Mo mo. People nearby are not the same people that everyone sees nearby. Each person sees different data, how do I load the cache? Or do you have a different, as long as the user wants to see, the data loaded into the cache it? In general, people like Momo, if you are to design a caching strategy, how do you design?????????

Let's talk about what you understand as "caching".
If you think caching is a magical thing that can speed up the program, then I have to give you a wake-up call, the "magic" is a cost, and you don't necessarily pay.

In general, when you decide to use the cache, there are a few points that you must consider first.
1) data is not sensitive to timeliness.
2) The performance bottleneck lies in the IO of the database
3) intermediate data, not final data

Strictly speaking, the people in the vicinity are not sensitive to timeliness. And the data should be in the middle data, not in the end should be in the storage. Even if there is a certain loss, or the display is empty, it should be acceptable, right?
You can simply drop the cache without considering the cost. But for the cache utilization, as well as the hit rate situation, it is necessary to see the actual invocation situation.
If a person near you, the amount of clicks itself is very small, it is possible not to do the cache.
The cache design can also be considered for your specific business situation.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.