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
    このウェブサイトの声明
    この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

    ホットAIツール

    Undresser.AI Undress

    Undresser.AI Undress

    リアルなヌード写真を作成する AI 搭載アプリ

    AI Clothes Remover

    AI Clothes Remover

    写真から衣服を削除するオンライン AI ツール。

    Undress AI Tool

    Undress AI Tool

    脱衣画像を無料で

    Clothoff.io

    Clothoff.io

    AI衣類リムーバー

    AI Hentai Generator

    AI Hentai Generator

    AIヘンタイを無料で生成します。

    ホットツール

    メモ帳++7.3.1

    メモ帳++7.3.1

    使いやすく無料のコードエディター

    SublimeText3 中国語版

    SublimeText3 中国語版

    中国語版、とても使いやすい

    ゼンドスタジオ 13.0.1

    ゼンドスタジオ 13.0.1

    強力な PHP 統合開発環境

    ドリームウィーバー CS6

    ドリームウィーバー CS6

    ビジュアル Web 開発ツール

    SublimeText3 Mac版

    SublimeText3 Mac版

    神レベルのコード編集ソフト(SublimeText3)

    PHPでsuccessメソッドを使用する方法 PHPでsuccessメソッドを使用する方法 Mar 06, 2023 am 09:12 AM

    PHPでsuccessメソッドを使用する方法

    Memcached キャッシュ テクノロジにより、PHP でのセッション処理が最適化されます。 Memcached キャッシュ テクノロジにより、PHP でのセッション処理が最適化されます。 May 16, 2023 am 08:41 AM

    Memcached キャッシュ テクノロジにより、PHP でのセッション処理が最適化されます。

    PHP8.0のキャッシュライブラリ: Memcached PHP8.0のキャッシュライブラリ: Memcached May 14, 2023 am 08:16 AM

    PHP8.0のキャッシュライブラリ: Memcached

    Memcached キャッシュ テクノロジを使用して PHP アプリケーションの CPU 使用率を最適化するにはどうすればよいですか? Memcached キャッシュ テクノロジを使用して PHP アプリケーションの CPU 使用率を最適化するにはどうすればよいですか? Jun 21, 2023 pm 05:07 PM

    Memcached キャッシュ テクノロジを使用して PHP アプリケーションの CPU 使用率を最適化するにはどうすればよいですか?

    AITOのWenjie M9パノラマスマートフラッグシップSUVが間もなくデビューします AITOのWenjie M9パノラマスマートフラッグシップSUVが間もなくデビューします Sep 26, 2023 pm 02:41 PM

    AITOのWenjie M9パノラマスマートフラッグシップSUVが間もなくデビューします

    Laravelで成功メソッドを使用する方法 Laravelで成功メソッドを使用する方法 Aug 10, 2023 pm 02:09 PM

    Laravelで成功メソッドを使用する方法

    Memcached キャッシュ テクノロジを使用して、PHP でのオーディオとビデオの再生を最適化します。 Memcached キャッシュ テクノロジを使用して、PHP でのオーディオとビデオの再生を最適化します。 May 17, 2023 pm 04:01 PM

    Memcached キャッシュ テクノロジを使用して、PHP でのオーディオとビデオの再生を最適化します。

    PHP および Memcached データベースのバックアップとリカバリ PHP および Memcached データベースのバックアップとリカバリ May 15, 2023 pm 09:12 PM

    PHP および Memcached データベースのバックアップとリカバリ

    See all articles