LearnfromMemcached 'ssuccess

Source: Internet
Author: User
Memcachedbecomesmoreandmorepopulw.wadays. Itiswidelyusedbymanyheavyloadedsites. Whydoesitsucceed? Well, ofcoursethefirstandthemostimportantreasonisthatitmeetstheneedforspeedoftheweb2.0sites, bycachi

Memcached becomes more and more popular nowadays. It is widely used by using 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 using 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 [ ] Rn Rn ")
  • Deletion:
    Delete [ ] [Noreply] rn
    Reply: ("DELETEDrn", "NOT_FOUNDrn ")
  • 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 ages. 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 wocould turn out to be really a wise demo.

    Original article address: Learn from Memcached's Success. Thank you for sharing it with me.

    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.