Memcache is a high-performance distributed memory object cache system. it maintains a unified and huge hash table in the memory and can be used to store data in various formats. simply put, the data is called to the memory and then read from the memory, which greatly improves the reading speed. Working Principle: ① when the client accesses the application for the first time, it will fetch data from the database (RDBMS) and return it to the client. it also saves the acquired data to memcached. & N
Memcache is a high-performance distributed memory object cache system. it maintains a unified and huge hash table in the memory and can be used to store data in various formats. simply put, the data is called to the memory and then read from the memory, which greatly improves the reading speed.
Working principle:
① When the client accesses the application for the first time, it will fetch data from the database (RDBMS) and return it to the client. it also saves the retrieved data to memcached.
② During the second access, because the data has been cached, you do not need to query the database, but directly retrieve the data from memcached.
How is memcached's speed and efficiency reflected? We all know that RDBMS is a file-type database and is stored on the disk as a file. Memcached is a key: value relational database, which is stored in memory. So I don't need to explain that the memory read/write speed is much faster than the disk read/write speed. The former is 6 times the latter's 10. Http://blog.rekfan.com /? P = 172
③ Memcached handles libevent-based events. Libevent is a library that encapsulates the epoll, kqueue, and other event processing functions of Linux operating systems into a unified interface. O (1) performance can be used even if the number of connections to the server increases. Memcached uses this libevent library to achieve high performance in Linux, BSD, Solaris, and other operating systems. For more information about event processing, see The C10K Problem of Dan Keel. For more information