Home Database Mysql Tutorial Learn from Memcached’s Success

Learn from Memcached’s Success

Jun 07, 2016 pm 04:25 PM
from m memcached success

Memcached becomes more and more popular nowadays. It is widely used by many heavy loaded sites. Why does it succeed? Well, of course the first and the most important reason is that it meets the need for speed of the web 2.0 sites, by cachi

Memcached becomes more and more popular nowadays. It is widely used by many heavy loaded sites. Why does it succeed?

Well, of course the first and the most important reason is that it meets the need for speed of the web 2.0 sites, by caching data and objects in memory. However, from the point of view of a server developer, what I want to emphasize is that it is the simplicity of memcached’s protocol design makes it more successful. Take a look at memcached’s protocol:

  • storage: ("set", "add", "replace", "append", "prepend", "cas")
              [noreply]rn
             cas [noreply]rn
         reply: ("ERRORrn", "CLIENT_ERROR rn", "SERVER_ERROR rn",
             "STOREDrn", "NOT_FOUNDrn", "EXISTSrn", "NOT_FOUNDrn")
  • retrieval: ("get", "gets")
             get rn
             gets rn
         reply: ("ENDrn",
             "VALUE []rnrn")
  • deletion:
             delete [
  • increment/decrement: ("incr", "decr")
             incr [noreply]rn
             decr [noreply]rn
         reply: ("NOT_FOUNDrn",
             "rn")
  • statistics: ("stat")
             statsrn
             stats rn
         reply: ("STAT rn",
             "STAT items:: rn"
             "ENDrn")
  • other:
         flush_all
         reply: ("OKrn")
         versionrn
         reply: ("VERSION rn")
         verbosity
         reply: ("OKrn")
         quit
  • With the textual protocol as shown above, memcache can be easily supported and implemented in various programming languages. No wonder dozens of different memcache clients appear. And then it consequently boosts memcached’s use. Simple thing usually will withstand the test of time. The old simple textual protocols, e.g., HTTP, FTP, SMTP and POP3 are still in use on the modern Internet. Not only because textual protocols can be easily parsed and extended, but also they are convenient for human being to read and debug. This is where the UNIX philosophy shines.

    In conclusion, always prefer textual protocol when designing your own application. It would turn out to be really a wise decision.

    Learn from Memcached’s Success
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

    Hot AI Tools

    Undresser.AI Undress

    Undresser.AI Undress

    AI-powered app for creating realistic nude photos

    AI Clothes Remover

    AI Clothes Remover

    Online AI tool for removing clothes from photos.

    Undress AI Tool

    Undress AI Tool

    Undress images for free

    Clothoff.io

    Clothoff.io

    AI clothes remover

    AI Hentai Generator

    AI Hentai Generator

    Generate AI Hentai for free.

    Hot Article

    R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
    2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
    Hello Kitty Island Adventure: How To Get Giant Seeds
    1 months ago By 尊渡假赌尊渡假赌尊渡假赌
    Two Point Museum: All Exhibits And Where To Find Them
    1 months ago By 尊渡假赌尊渡假赌尊渡假赌

    Hot Tools

    Notepad++7.3.1

    Notepad++7.3.1

    Easy-to-use and free code editor

    SublimeText3 Chinese version

    SublimeText3 Chinese version

    Chinese version, very easy to use

    Zend Studio 13.0.1

    Zend Studio 13.0.1

    Powerful PHP integrated development environment

    Dreamweaver CS6

    Dreamweaver CS6

    Visual web development tools

    SublimeText3 Mac version

    SublimeText3 Mac version

    God-level code editing software (SublimeText3)

    How to use success method in php How to use success method in php Mar 06, 2023 am 09:12 AM

    The success method in php is used to display a success message. Its usage syntax is "Success('...','Http://www.xxx.com/Admin/User/Index');", when we do not write Url, the system will determine whether there is a previous page. If there is a system, it will jump to the previous page, otherwise it will not jump.

    Memcached caching technology optimizes Session processing in PHP Memcached caching technology optimizes Session processing in PHP May 16, 2023 am 08:41 AM

    Memcached is a commonly used caching technology that can greatly improve the performance of web applications. In PHP, the commonly used Session processing method is to store the Session file on the server's hard disk. However, this method is not optimal because the server's hard disk will become one of the performance bottlenecks. The use of Memcached caching technology can optimize Session processing in PHP and improve the performance of Web applications. Session in PHP

    Caching library in PHP8.0: Memcached Caching library in PHP8.0: Memcached May 14, 2023 am 08:16 AM

    Caching library in PHP8.0: Memcached With the rapid development of the Internet, modern applications require efficient and reliable caching technology to improve performance and handle large amounts of data. Due to PHP's popularity and open source nature, the PHP caching library has become an essential tool in the web development community. Memcached is a widely used open source high-speed memory caching system that can handle millions of simultaneous connected cache requests and can be used in many different types of applications, such as social networks, online

    AITO's Wenjie M9 panoramic smart flagship SUV is about to debut AITO's Wenjie M9 panoramic smart flagship SUV is about to debut Sep 26, 2023 pm 02:41 PM

    According to news on September 25, Huawei Mall has begun accepting reservations for AITO’s Wenjie M9 car. This car is positioned as a panoramic smart flagship SUV with eye-catching features. Consumers only need to pay a deposit of 5,000 yuan, which can be used to offset the final payment of up to 10,000 yuan. The new car will be available in two versions, namely the extended-range version and the pure electric version. The price is expected to be between 500,000 yuan and 600,000 yuan, making it competitive in the high-end SUV market. Wenjie M9 is expected to be officially launched in the fourth quarter of 2023. No information on its specific configuration has been disclosed yet. It is understood that the M9 model adopts a family-oriented design language. Judging from the two official pictures, the side lines of the vehicle are smooth, and the door handles adopt a hidden design, adding technology to the entire vehicle.

    How to optimize PHP application CPU usage using Memcached caching technology? How to optimize PHP application CPU usage using Memcached caching technology? Jun 21, 2023 pm 05:07 PM

    With the development of the Internet, PHP applications have become more and more common in the field of Internet applications. However, high concurrent access by PHP applications can lead to high CPU usage on the server, thus affecting the performance of the application. In order to optimize the performance of PHP applications, Memcached caching technology has become a good choice. This article will introduce how to use Memcached caching technology to optimize the CPU usage of PHP applications. Introduction to Memcached caching technology Memcached is a

    How to use the success method in laravel How to use the success method in laravel Aug 10, 2023 pm 02:09 PM

    In Laravel, the success method is used to return a successful response in the controller. To use the success method, we need to introduce the Response class in the controller. Then, we can use an instance of this class to call the success method. You can set the response message, the data to be returned, the response status code, and pass these parameters to the success method. A successful response will be returned, which contains the message and user data we set.

    PHP and Memcached database backup and recovery PHP and Memcached database backup and recovery May 15, 2023 pm 09:12 PM

    With the rapid development of the Internet, large-scale MySQL database backup and recovery has become one of the essential skills for major enterprises and websites. With the widespread application of Memcached, how to back up and restore Memcached has also become an important issue. As one of the main languages ​​for web development, PHP has unique advantages and skills in handling backup and recovery of MySQL and Memcached. This article will introduce in detail the implementation method of PHP processing MySQL and Memcached backup and recovery.

    Use Memcached caching technology to optimize audio and video playback in PHP Use Memcached caching technology to optimize audio and video playback in PHP May 17, 2023 pm 04:01 PM

    With the continuous development of Internet technology, audio and video resources have become a very important form of content on the Internet, and PHP, as one of the most widely used languages ​​in network development, is also constantly used in the field of video and audio playback. However, with the increasing number of users of audio and video websites, many websites have discovered a problem: under high concurrency conditions, PHP's processing speed of audio and video slows down significantly, resulting in problems such as inability to play in time or stuck playback. To solve this problem, Memcached caching technology should

    See all articles