Distributed cache system memcached

Source: Internet
Author: User

Distributed is the main feature of memcached, so you can install memcached on multiple servers to build a larger cache server. In this way, memcached can help us minimize the database pressure, so that we can build faster and more scalable Web applications. Figure 1 shows how memcache works with the database.


Figure 1: How memcache works with databases

How does memcache work?

Figure 1 shows the process. I believe that anyone who has developed database applications will be familiar with it. Let's explain step by step what happened in the figure:

  1. Check whether the data requested by the user exists in the cache. If yes, you only need to directly return the requested data, which is totally irrelevant to the database.
  2. If the requested data cannot be found in the cache, query the database again. When the request data is returned, the data is stored in the cache.
  3. Keep the cache fresh. When data changes (for example, data is modified or deleted), the cache information must be updated synchronously, make sure that the user does not get the old data in the cache.

Obviously, memcached can play a major role in High-concurrency data queries and massive data output. Because Accessing memory data in memcached is much faster than the disk data in the database.

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.