diff options
Diffstat (limited to 'doc/protocol-binary.txt')
-rw-r--r-- | doc/protocol-binary.txt | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/doc/protocol-binary.txt b/doc/protocol-binary.txt index aa9ee66..710a69a 100644 --- a/doc/protocol-binary.txt +++ b/doc/protocol-binary.txt @@ -117,12 +117,12 @@ Internet-Draft Memcache Binary Protocol August 2008 Memcache is a high performance key-value cache. It is intentionally a dumb cache, optimized for speed only. Applications using memcache - do not rely on it for data -- a persistent database with guaranteed - reliability is strongly recommended -- but applications can run much - faster when cached data is available in memcache. + should not rely on it for data -- a persistent database with + guaranteed reliability is strongly recommended -- but applications + can run much faster when cached data is available in memcache. - Memcache was originally written to make LiveJournal [LJ] go faster. - It now powers all of the fastest web sites that you love. + Memcache was originally written to make LiveJournal [LJ] faster. It + now powers all of the fastest web sites that you love. 1.1. Conventions Used In This Document @@ -145,7 +145,7 @@ Internet-Draft Memcache Binary Protocol August 2008 / / +---------------+---------------+---------------+---------------+ 24/ COMMAND-SPECIFIC EXTRAS (as needed) / - +/ (note length in th extras length header field) / + +/ (note length in the extras length header field) / +---------------+---------------+---------------+---------------+ m/ Key (as needed) / +/ (note length in key length header field) / @@ -231,7 +231,7 @@ Internet-Draft Memcache Binary Protocol August 2008 Reserved Really reserved for future use (up for grabs). Total body length Length in bytes of extra + key + value. Opaque Will be copied back to you in the response. - CAS Data version check + CAS Data version check. 3. Defined Values @@ -243,10 +243,10 @@ Internet-Draft Memcache Binary Protocol August 2008 Magic byte / version. For each version of the protocol, we'll use a different request/response value pair. This is useful for protocol - analyzers to know what a packet is in isolation from which direction - it is moving. Note that it is common to run a memcached instance on - a host that also runs an application server. Such a host will both - send and receive memcache packets. + analyzers to distinguish the nature of the packet from the direction + which it is moving. Note, it is common to run a memcached instance + on a host that also runs an application server. Such a host will + both send and receive memcache packets. The version should hopefully correspond only to different meanings of the command byte. In an ideal world, we will not change the header @@ -255,7 +255,7 @@ Internet-Draft Memcache Binary Protocol August 2008 Traffic analysis tools are encouraged to identify memcache packets and provide detailed interpretation if the magic bytes are recognized - and otherwise to provide a generic breakdown of the packet. Note + and otherwise to provide a generic breakdown of the packet. Note, that the key and value positions can always be identified even if the magic byte or command opcode are not recognized. @@ -265,7 +265,7 @@ Internet-Draft Memcache Binary Protocol August 2008 0x0000 No error 0x0001 Key not found 0x0002 Key exists - 0x0003 Value too big + 0x0003 Value too large 0x0004 Invalid arguments 0x0005 Item not stored 0x0081 Unknown command @@ -315,11 +315,11 @@ Internet-Draft Memcache Binary Protocol August 2008 4.1. Introduction All communication is initiated by a request from the client, and the - server will respond to each request with zero or multiple packets - from each request. If the server respond with a message with a non- - nil status code, the body of the packet contains a textual error - message. If the status code is nil, the command opcode will define - the layout of the body of the message. + server will respond to each request with zero or multiple packets for + each request. If the status code of a response packet is non-nil, + the body of the packet will contain a textual error message. If the + status code is nil, the command opcode will define the layout of the + body of the message. 4.1.1. Example @@ -423,16 +423,16 @@ Internet-Draft Memcache Binary Protocol August 2008 key into the response packet. You're not guaranteed a response to a getq/getkq cache hit until you - send a non-getq/getkq command later, which uncorks the server which + send a non-getq/getkq command later, which uncorks the server and bundles up IOs to send to the client in one go. Clients should implement multi-get (still important for reducing network roundtrips!) as n pipelined requests, the first n-1 being - getq/getkq, the last being a regular get/getk. that way you're + getq/getkq, the last being a regular get/getk. That way you're guaranteed to get a response, and you know when the server's done. - you can also do the naive thing and send n pipelined get/getks, but + You can also do the naive thing and send n pipelined get/getks, but then you could potentially get back a lot of "NOT_FOUND" error code - packets. alternatively, you can send 'n' getq/getkqs, followed by a + packets. Alternatively, you can send 'n' getq/getkqs, followed by a 'noop' command. 4.2.1. Example @@ -605,7 +605,7 @@ Internet-Draft Memcache Binary Protocol August 2008 Extras : Flags (24-27): 0xdeadbeef Key (28-32): The textual string: "Hello" - Value (33-37): The textual string "World" + Value (33-37): The textual string: "World" @@ -646,7 +646,7 @@ Internet-Draft Memcache Binary Protocol August 2008 Replace MUST fail if the item doesn't exist. - Set should store the data unconditionally if the item exists or not.. + Set should store the data unconditionally if the item exists or not. 4.3.1. Example @@ -729,9 +729,9 @@ Stone & Norbye Expires March 1, 2009 [Page 13] Internet-Draft Memcache Binary Protocol August 2008 - The response-packet contains no extra data, and the result of + The response-packet contains no extra data, and the result of the operation is signaled through the status code. If the command - succeed, the CAS value for the item is returned in the CAS-field of + succeeds, the CAS value for the item is returned in the CAS-field of the packet. Successful add response: @@ -772,7 +772,7 @@ Internet-Draft Memcache Binary Protocol August 2008 4.4. Delete - MUST NOT have extras + MUST NOT have extras. MUST have key. MUST NOT have value. @@ -787,7 +787,7 @@ Internet-Draft Memcache Binary Protocol August 2008 4.4.1. Example - The following figure shows a delete message for the item "Hello" + The following figure shows a delete message for the item "Hello". Delete request: @@ -828,7 +828,7 @@ Internet-Draft Memcache Binary Protocol August 2008 Key : The textual string "Hello" Value : None - The response-packet contains no extra data, and the result of + The response-packet contains no extra data, and the result of the operation is signaled through the status code. @@ -1105,7 +1105,7 @@ Internet-Draft Memcache Binary Protocol August 2008 Key : None Value : None - The response-packet contains no extra data, and the result of + The response-packet contains no extra data, and the result of the operation is signaled through the status code. The server will then close the connection. @@ -1121,7 +1121,7 @@ Stone & Norbye Expires March 1, 2009 [Page 20] Internet-Draft Memcache Binary Protocol August 2008 - MAY have extras + MAY have extras. MUST NOT have key. MUST NOT have value. @@ -1137,10 +1137,10 @@ Internet-Draft Memcache Binary Protocol August 2008 +---------------+---------------+---------------+---------------+ Total 4 bytes - Flush the items in the cache now or sometime in the future specified - by the expiration field. See the documentation of the textual - protocol for the full description on how to specify the expiration - time. + Flush the items in the cache now or some time in the future as + specified by the expiration field. See the documentation of the + textual protocol for the full description on how to specify the + expiration time. 4.7.1. Example @@ -1214,7 +1214,7 @@ Internet-Draft Memcache Binary Protocol August 2008 Key : None Value : None - The response-packet contains no extra data, and the result of + The response-packet contains no extra data, and the result of the operation is signaled through the status code. 4.8. noop @@ -1269,7 +1269,7 @@ Internet-Draft Memcache Binary Protocol August 2008 Key : None Value : None - The response-packet contains no extra data, and the result of + The response-packet contains no extra data, and the result of the operation is signaled through the status code. 4.9. version @@ -1280,7 +1280,7 @@ Internet-Draft Memcache Binary Protocol August 2008 Request the server version. - The server respond with a packet containing the version string in the + The server responds with a packet containing the version string in @@ -1289,7 +1289,7 @@ Stone & Norbye Expires March 1, 2009 [Page 23] Internet-Draft Memcache Binary Protocol August 2008 - body with the following format: "x.y.z" + the body with the following format: "x.y.z" 4.9.1. Example @@ -1443,7 +1443,7 @@ Internet-Draft Memcache Binary Protocol August 2008 Key (24-28): The textual string "Hello" Value (29) : "!" - The response-packet contains no extra data, and the result of + The response-packet contains no extra data, and the result of the operation is signaled through the status code. @@ -1465,10 +1465,10 @@ Internet-Draft Memcache Binary Protocol August 2008 Request server statistics. Without a key specified the server will respond with a "default" set of statistics information. Each piece - of statistical information is returned in it's own packet (key + of statistical information is returned in its own packet (key contains the name of the statistical item and the body contains the - value in ASCII format). The sequence of return packet is terminated - with a packet with no key and no value. + value in ASCII format). The sequence of return packets is terminated + with a packet that contains no key and no value. 4.11.1. Example @@ -1547,9 +1547,9 @@ Internet-Draft Memcache Binary Protocol August 2008 Key : None Value : None - The server will send send each value in a separate packet with an - "empty" packet (no key / no value) to terminate the sequence. Each - of the response packets look like the following example: + The server will send each value in a separate packet with an "empty" + packet (no key / no value) to terminate the sequence. Each of the + response packets look like the following example: |