summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2009-03-22 15:08:06 +0100
committerantirez <antirez@gmail.com>2009-03-22 15:08:06 +0100
commit029524dbff9b076a5d1b7b97428981519e34886b (patch)
treeeefbbfc709862bc178aaa9b18de1e99948aa36a7
parenta74f2af61cb83e104cc9cc5ebd9292f14b6802fa (diff)
downloadredis-029524dbff9b076a5d1b7b97428981519e34886b.tar.gz
added doc for MGET
-rw-r--r--doc/CommandReference.html2
-rw-r--r--doc/FAQ.html4
-rw-r--r--doc/VersionControl.html40
3 files changed, 3 insertions, 43 deletions
diff --git a/doc/CommandReference.html b/doc/CommandReference.html
index 18b00924a..c42f57668 100644
--- a/doc/CommandReference.html
+++ b/doc/CommandReference.html
@@ -27,7 +27,7 @@
<div class="narrow">
<h1><a name="Redis Command Reference">Redis Command Reference</a></h1>Every command name links to a specific wiki page describing the behavior of the command.<h2><a name="Connection handling">Connection handling</a></h2><ul><li> <a href="QuitCommand.html">QUIT</a> <code name="code" class="python">close the connection</code></li></ul>
-<h2><a name="Commands operating on string values">Commands operating on string values</a></h2><ul><li> <a href="SetCommand.html">SET</a> <i>key</i> <i>value</i> <code name="code" class="python">set a key to a string value</code></li><li> <a href="GetCommand.html">GET</a> <i>key</i> <code name="code" class="python">return the string value of the key</code></li><li> <a href="SetnxCommand.html">SETNX</a> <i>key</i> <i>value</i> <code name="code" class="python">set a key to a string value if the key does not exist</code></li><li> <a href="IncrCommand.html">INCR</a> <i>key</i> <code name="code" class="python">increment the integer value of key</code></li><li> <a href="IncrCommand.html">INCRBY</a> <i>key</i> <i>integer</i><code name="code" class="python"> increment the integer value of key by integer</code></li><li> <a href="IncrCommand.html">INCR</a> <i>key</i> <code name="code" class="python">decrement the integer value of key</code></li><li> <a href="IncrCommand.html">DECRBY</a> <i>key</i> <i>integer</i> <code name="code" class="python">decrement the integer value of key by integer</code></li><li> <a href="ExistsCommand.html">EXISTS</a> <i>key</i> <code name="code" class="python">test if a key exists</code></li><li> <a href="DelCommand.html">DEL</a> <i>key</i> <code name="code" class="python">delete a key</code></li><li> <a href="TypeCommand.html">TYPE</a> <i>key</i> <code name="code" class="python">return the type of the value stored at key</code></li></ul>
+<h2><a name="Commands operating on string values">Commands operating on string values</a></h2><ul><li> <a href="SetCommand.html">SET</a> <i>key</i> <i>value</i> <code name="code" class="python">set a key to a string value</code></li><li> <a href="GetCommand.html">GET</a> <i>key</i> <code name="code" class="python">return the string value of the key</code></li><li> <a href="MgetCommand.html">MGET</a> <i>key1</i> <i>key2</i> ... <i>keyN</i> <code name="code" class="python">multi-get, return the strings values of the keys</code></li><li> <a href="SetnxCommand.html">SETNX</a> <i>key</i> <i>value</i> <code name="code" class="python">set a key to a string value if the key does not exist</code></li><li> <a href="IncrCommand.html">INCR</a> <i>key</i> <code name="code" class="python">increment the integer value of key</code></li><li> <a href="IncrCommand.html">INCRBY</a> <i>key</i> <i>integer</i><code name="code" class="python"> increment the integer value of key by integer</code></li><li> <a href="IncrCommand.html">INCR</a> <i>key</i> <code name="code" class="python">decrement the integer value of key</code></li><li> <a href="IncrCommand.html">DECRBY</a> <i>key</i> <i>integer</i> <code name="code" class="python">decrement the integer value of key by integer</code></li><li> <a href="ExistsCommand.html">EXISTS</a> <i>key</i> <code name="code" class="python">test if a key exists</code></li><li> <a href="DelCommand.html">DEL</a> <i>key</i> <code name="code" class="python">delete a key</code></li><li> <a href="TypeCommand.html">TYPE</a> <i>key</i> <code name="code" class="python">return the type of the value stored at key</code></li></ul>
<h2><a name="Commands operating on the key space">Commands operating on the key space</a></h2><ul><li> <a href="KeysCommand.html">KEYS</a> <i>pattern</i> <code name="code" class="python">return all the keys matching a given pattern</code></li><li> <a href="RandomkeyCommand.html">RANDOMKEY</a> <code name="code" class="python">return a random key from the key space</code></li><li> <a href="RenameCommand.html">RENAME</a> <i>oldname</i> <i>newname</i> <code name="code" class="python">rename the old key in the new one, destroing the newname key if it already exists</code></li><li> <a href="RenamenxCommand.html">RENAMENX</a> <i>oldname</i> <i>newname</i> <code name="code" class="python">rename the old key in the new one, if the newname key does not already exist</code></li><li> <a href="Dbsize.html">DBSIZE</a> <code name="code" class="python">return the number of keys in the current db</code></li></ul>
<h2><a name="Commands operating on lists">Commands operating on lists</a></h2><ul><li> <a href="RpushCommand.html">RPUSH</a> <i>key</i> <i>value</i> <code name="code" class="python">Append an element to the tail of the List value at key</code></li><li> <a href="RpushCommand.html">LPUSH</a> <i>key</i> <i>value</i> <code name="code" class="python">Append an element to the head of the List value at key</code></li><li> <a href="LlenCommand.html">LLEN</a> <i>key</i> <code name="code" class="python">Return the length of the List value at key</code></li><li> <a href="LrangeCommand.html">LRANGE</a> <i>key</i> <i>start</i> <i>end</i> <code name="code" class="python">Return a range of elements from the List at key</code></li><li> <a href="LtrimCommand.html">LTRIM</a> <i>key</i> <i>start</i> <i>end</i> <code name="code" class="python">Trim the list at key to the specified range of elements</code></li><li> <a href="LindexCommand.html">LINDEX</a> <i>key</i> <i>index</i> <code name="code" class="python">Return the element at index position from the List at key</code></li><li> <a href="LsetCommand.html">LSET</a> <i>key</i> <i>index</i> <i>value</i> <code name="code" class="python">Set a new value as the element at index position of the List at key</code></li><li> <a href="LremCommand.html">LREM</a> <i>key</i> <i>count</i> <i>value</i> <code name="code" class="python">Remove the first-N, last-N, or all the elements matching value from the List at key</code></li><li> <a href="LpopCommand.html">LPOP</a> <i>key</i> <code name="code" class="python">Return and remove (atomically) the first element of the List at key</code></li><li> <a href="LpopCommand.html">RPOP</a> <i>key</i> <code name="code" class="python">Return and remove (atomically) the last element of the List at key</code></li></ul>
<h2><a name="Commands operating on sets">Commands operating on sets</a></h2><ul><li> <a href="SaddCommand.html">SADD</a> <i>key</i> <i>member</i> <code name="code" class="python">Add the specified member to the Set value at key</code></li><li> <a href="SremCommand.html">SREM</a> <i>key</i> <i>member</i> <code name="code" class="python">Remove the specified member from the Set value at key</code></li><li> <a href="ScardCommand.html">SCARD</a> <i>key</i> <code name="code" class="python">Return the number of elements (the cardinality) of the Set at key</code></li><li> <a href="SismemberCommand.html">SISMEMBER</a> <i>key</i> <i>member</i> <code name="code" class="python">Test if the specified value is a member of the Set at key</code></li><li> <a href="SinterCommand.html">SINTER</a> <i>key1</i> <i>key2</i> ... <i>keyN</i> <code name="code" class="python">Return the intersection between the Sets stored at key1, key2, ..., keyN</code></li><li> <a href="SinterCommand.html">SINTERSTORE</a> <i>dstkey</i> <i>key1</i> <i>key2</i> ... <i>keyN</i> <code name="code" class="python">Compute the intersection between the Sets stored at key1, key2, ..., keyN, and store the resulting Set at dstkey</code></li><li> <a href="SmembersCommand.html">SMEMBERS</a> <i>key</i> <code name="code" class="python">Return all the members of the Set value at key</code></li></ul>
diff --git a/doc/FAQ.html b/doc/FAQ.html
index a7f8dcaf3..d35808434 100644
--- a/doc/FAQ.html
+++ b/doc/FAQ.html
@@ -16,7 +16,7 @@
<div id="pagecontent">
<div class="index">
<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>FAQ: Contents</b><br>&nbsp;&nbsp;<a href="#Why I need Redis if there is already memcachedb, Tokyo Cabinet, ...?">Why I need Redis if there is already memcachedb, Tokyo Cabinet, ...?</a><br>&nbsp;&nbsp;<a href="#Isn't this key-value thing just hype?">Isn't this key-value thing just hype?</a><br>&nbsp;&nbsp;<a href="#Can I backup a Redis DB while the server is working?">Can I backup a Redis DB while the server is working?</a><br>&nbsp;&nbsp;<a href="#What's the Redis memory footprint?">What's the Redis memory footprint?</a><br>&nbsp;&nbsp;<a href="#I like Redis high level operations and features, but I don't like it takes everything in memory and I can't have a dataset larger the memory. Plans to change this?">I like Redis high level operations and features, but I don't like it takes everything in memory and I can't have a dataset larger the memory. Plans to change this?</a><br>&nbsp;&nbsp;<a href="#Ok but I absolutely need to have a DB larger than memory, still I need the Redis features">Ok but I absolutely need to have a DB larger than memory, still I need the Redis features</a><br>&nbsp;&nbsp;<a href="#What happens if Redis runs out of memory?">What happens if Redis runs out of memory?</a><br>&nbsp;&nbsp;<a href="#What Redis means actually?">What Redis means actually?</a><br>&nbsp;&nbsp;<a href="#Why did you started the Redis project?">Why did you started the Redis project?</a>
+<b>FAQ: Contents</b><br>&nbsp;&nbsp;<a href="#Why I need Redis if there is already memcachedb, Tokyo Cabinet, ...?">Why I need Redis if there is already memcachedb, Tokyo Cabinet, ...?</a><br>&nbsp;&nbsp;<a href="#Isn't this key-value thing just hype?">Isn't this key-value thing just hype?</a><br>&nbsp;&nbsp;<a href="#Can I backup a Redis DB while the server is working?">Can I backup a Redis DB while the server is working?</a><br>&nbsp;&nbsp;<a href="#What's the Redis memory footprint?">What's the Redis memory footprint?</a><br>&nbsp;&nbsp;<a href="#I like Redis high level operations and features, but I don't like it takes everything in memory and I can't have a dataset larger the memory. Plans to change this?">I like Redis high level operations and features, but I don't like it takes everything in memory and I can't have a dataset larger the memory. Plans to change this?</a><br>&nbsp;&nbsp;<a href="#Ok but I absolutely need to have a DB larger than memory, still I need the Redis features">Ok but I absolutely need to have a DB larger than memory, still I need the Redis features</a><br>&nbsp;&nbsp;<a href="#I have an empty Redis server but INFO and logs are reporting megabytes of memory in use!">I have an empty Redis server but INFO and logs are reporting megabytes of memory in use!</a><br>&nbsp;&nbsp;<a href="#What happens if Redis runs out of memory?">What happens if Redis runs out of memory?</a><br>&nbsp;&nbsp;<a href="#What Redis means actually?">What Redis means actually?</a><br>&nbsp;&nbsp;<a href="#Why did you started the Redis project?">Why did you started the Redis project?</a>
</div>
<h1 class="wikiname">FAQ</h1>
@@ -34,7 +34,7 @@ So Redis offers more features:<br/><br/><ul><li> Keys can store different data t
<ul><li> We wrote a <a href="http://retwis.antirez.com" target="_blank">simple Twitter Clone</a> using just Redis as database. Download the source code from the download section and imagine to write it with a plain key-value DB without support for lists and sets... it's <b>much</b> harder.</li></ul>
<ul><li> Multiple DBs. Using the SELECT command the client can select different datasets. This is useful because Redis provides a MOVE atomic primitive that moves a key form a DB to another one, if the target DB already contains such a key it returns an error: this basically means a way to perform locking in distributed processing.</li></ul>
<ul><li> <b>So what is Redis really about?</b> The User interface with the programmer. Redis aims to export to the programmer the right tools to model a wide range of problems. <b>Sets, Lists with O(1) push operation, lrange and ltrim, server-side fast intersection between sets, are primitives that allow to model complex problems with a key value database</b>.</li></ul>
-<h1><a name="Isn't this key-value thing just hype?">Isn't this key-value thing just hype?</a></h1>I imagine key-value DBs, in the short term future, to be used like you use memory in a program, with lists, hashes, and so on. With Redis it's like this, but this special kind of memory containing your data structures is shared, atomic, persistent.<br/><br/>When we write code it is obvious, when we take data in memory, to use the most sensible data structure for the work, right? Incredibly when data is put inside a relational DB this is no longer true, and we create an absurd data model even if our need is to put data and get this data back in the same order we put it inside (an ORDER BY is required when the data should be already sorted. Strange, dont' you think?).<br/><br/>Key-value DBs bring this back at home, to create sensible data models and use the right data structures for the problem we are trying to solve.<h1><a name="Can I backup a Redis DB while the server is working?">Can I backup a Redis DB while the server is working?</a></h1>Yes you can. When Redis saves the DB it actually creates a temp file, then rename(2) that temp file name to the destination file name. So even while the server is working it is safe to save the database file just with the <i>cp</i> unix command. Note that you can use master-slave replication in order to have redundancy of data, but if all you need is backups, cp or scp will do the work pretty well.<h1><a name="What's the Redis memory footprint?">What's the Redis memory footprint?</a></h1>Worst case scenario: 1 Million keys with the key being the natural numbers from 0 to 999999 and the string &quot;Hello World&quot; as value use 100MB on my Intel macbook (32bit). Note that the same data stored linearly in an unique string takes something like 16MB, this is the norm because with small keys and values there is a lot of overhead. Memcached will perform similarly.<br/><br/>With large keys/values the ratio is much better of course.<br/><br/>64 bit systems will use much more memory than 32 bit systems to store the same keys, especially if the keys and values are small, this is because pointers takes 8 bytes in 64 bit systems. But of course the advantage is that you can have a lot of memory in 64 bit systems, so to run large Redis servers a 64 bit system is more or less required.<h1><a name="I like Redis high level operations and features, but I don't like it takes everything in memory and I can't have a dataset larger the memory. Plans to change this?">I like Redis high level operations and features, but I don't like it takes everything in memory and I can't have a dataset larger the memory. Plans to change this?</a></h1>The whole key-value hype started for a reason: performances. Redis takes the whole dataset in memory and writes asynchronously on disk in order to be very fast, you have the best of both worlds: hyper-speed and persistence of data, but the price to pay is exactly this, that the dataset must fit on your computers RAM.<br/><br/>If the data is larger then memory, and this data is stored on disk, what happens is that the bottleneck of the disk I/O speed will start to ruin the performances. Maybe not in benchmarks, but once you have real load with distributed key accesses the data must come from disk, and the disk is damn slow. Not only, but Redis supports higher level data structures than the plain values. To implement this things on disk is even slower.<br/><br/>Redis will always continue to hold the whole dataset in memory because this days scalability requires to use RAM as storage media, and RAM is getting cheaper and cheaper. Today it is common for an entry level server to have 16 GB of RAM! And in the 64-bit era there are no longer limits to the amount of RAM you can have in theory.<h1><a name="Ok but I absolutely need to have a DB larger than memory, still I need the Redis features">Ok but I absolutely need to have a DB larger than memory, still I need the Redis features</a></h1>One possible solution is to use both MySQL and Redis at the same time, basically take the state on Redis, and all the things that get accessed very frequently: user auth tokens, Redis Lists with chronologically ordered IDs of the last N-comments, N-posts, and so on. Then use MySQL as a simple storage engine for larger data, that is just create a table with an auto-incrementing ID as primary key and a large BLOB field as data field. Access MySQL data only by primary key (the ID). The application will run the high traffic queries against Redis but when there is to take the big data will ask MySQL for specific resources IDs.<h1><a name="What happens if Redis runs out of memory?">What happens if Redis runs out of memory?</a></h1>With modern operating systems malloc() returning NULL is not common, usually the server will start swapping and Redis performances will be disastrous so you'll know it's time to use more Redis servers or get more RAM.<br/><br/>However it is planned to add a configuration directive to tell Redis to stop accepting queries but instead to SAVE the latest data and quit if it is using more than a given amount of memory. Also the new INFO command (work in progress in this days) will report the amount of memory Redis is using so you can write scripts that monitor your Redis servers checking for critical conditions.<br/><br/>Update: redis SVN is able to know how much memory it is using and report it via the <a href="InfoCommand.html">INFO</a> command.<h1><a name="What Redis means actually?">What Redis means actually?</a></h1>Redis means two things:
+<h1><a name="Isn't this key-value thing just hype?">Isn't this key-value thing just hype?</a></h1>I imagine key-value DBs, in the short term future, to be used like you use memory in a program, with lists, hashes, and so on. With Redis it's like this, but this special kind of memory containing your data structures is shared, atomic, persistent.<br/><br/>When we write code it is obvious, when we take data in memory, to use the most sensible data structure for the work, right? Incredibly when data is put inside a relational DB this is no longer true, and we create an absurd data model even if our need is to put data and get this data back in the same order we put it inside (an ORDER BY is required when the data should be already sorted. Strange, dont' you think?).<br/><br/>Key-value DBs bring this back at home, to create sensible data models and use the right data structures for the problem we are trying to solve.<h1><a name="Can I backup a Redis DB while the server is working?">Can I backup a Redis DB while the server is working?</a></h1>Yes you can. When Redis saves the DB it actually creates a temp file, then rename(2) that temp file name to the destination file name. So even while the server is working it is safe to save the database file just with the <i>cp</i> unix command. Note that you can use master-slave replication in order to have redundancy of data, but if all you need is backups, cp or scp will do the work pretty well.<h1><a name="What's the Redis memory footprint?">What's the Redis memory footprint?</a></h1>Worst case scenario: 1 Million keys with the key being the natural numbers from 0 to 999999 and the string &quot;Hello World&quot; as value use 100MB on my Intel macbook (32bit). Note that the same data stored linearly in an unique string takes something like 16MB, this is the norm because with small keys and values there is a lot of overhead. Memcached will perform similarly.<br/><br/>With large keys/values the ratio is much better of course.<br/><br/>64 bit systems will use much more memory than 32 bit systems to store the same keys, especially if the keys and values are small, this is because pointers takes 8 bytes in 64 bit systems. But of course the advantage is that you can have a lot of memory in 64 bit systems, so to run large Redis servers a 64 bit system is more or less required.<h1><a name="I like Redis high level operations and features, but I don't like it takes everything in memory and I can't have a dataset larger the memory. Plans to change this?">I like Redis high level operations and features, but I don't like it takes everything in memory and I can't have a dataset larger the memory. Plans to change this?</a></h1>The whole key-value hype started for a reason: performances. Redis takes the whole dataset in memory and writes asynchronously on disk in order to be very fast, you have the best of both worlds: hyper-speed and persistence of data, but the price to pay is exactly this, that the dataset must fit on your computers RAM.<br/><br/>If the data is larger then memory, and this data is stored on disk, what happens is that the bottleneck of the disk I/O speed will start to ruin the performances. Maybe not in benchmarks, but once you have real load with distributed key accesses the data must come from disk, and the disk is damn slow. Not only, but Redis supports higher level data structures than the plain values. To implement this things on disk is even slower.<br/><br/>Redis will always continue to hold the whole dataset in memory because this days scalability requires to use RAM as storage media, and RAM is getting cheaper and cheaper. Today it is common for an entry level server to have 16 GB of RAM! And in the 64-bit era there are no longer limits to the amount of RAM you can have in theory.<h1><a name="Ok but I absolutely need to have a DB larger than memory, still I need the Redis features">Ok but I absolutely need to have a DB larger than memory, still I need the Redis features</a></h1>One possible solution is to use both MySQL and Redis at the same time, basically take the state on Redis, and all the things that get accessed very frequently: user auth tokens, Redis Lists with chronologically ordered IDs of the last N-comments, N-posts, and so on. Then use MySQL as a simple storage engine for larger data, that is just create a table with an auto-incrementing ID as primary key and a large BLOB field as data field. Access MySQL data only by primary key (the ID). The application will run the high traffic queries against Redis but when there is to take the big data will ask MySQL for specific resources IDs.<h1><a name="I have an empty Redis server but INFO and logs are reporting megabytes of memory in use!">I have an empty Redis server but INFO and logs are reporting megabytes of memory in use!</a></h1>This may happen and it's prefectly ok. Redis objects are small C structures allocated and freed a lot of times. This costs a lot of CPU so instead of being freed, released objects are taken into a free list and reused when needed. This memory is taken exactly by this free objects ready to be reused.<h1><a name="What happens if Redis runs out of memory?">What happens if Redis runs out of memory?</a></h1>With modern operating systems malloc() returning NULL is not common, usually the server will start swapping and Redis performances will be disastrous so you'll know it's time to use more Redis servers or get more RAM.<br/><br/>However it is planned to add a configuration directive to tell Redis to stop accepting queries but instead to SAVE the latest data and quit if it is using more than a given amount of memory. Also the new INFO command (work in progress in this days) will report the amount of memory Redis is using so you can write scripts that monitor your Redis servers checking for critical conditions.<br/><br/>Update: redis SVN is able to know how much memory it is using and report it via the <a href="InfoCommand.html">INFO</a> command.<h1><a name="What Redis means actually?">What Redis means actually?</a></h1>Redis means two things:
<ul><li> it's a joke on the word Redistribute (instead to use just a Relational DB redistribute your workload among Redis servers)</li><li> it means REmote DIctionary Server</li></ul>
<h1><a name="Why did you started the Redis project?">Why did you started the Redis project?</a></h1>In order to scale <a href="http://lloogg.com" target="_blank">LLOOGG</a>. But after I got the basic server working I liked the idea to share the work with other guys, and Redis was turned into an open source project.
diff --git a/doc/VersionControl.html b/doc/VersionControl.html
deleted file mode 100644
index bb249a327..000000000
--- a/doc/VersionControl.html
+++ /dev/null
@@ -1,40 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>VersionControl: Contents</b><br>&nbsp;&nbsp;<a href="#VERSION">VERSION</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a>
- </div>
-
- <h1 class="wikiname">VersionControl</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="VERSION">VERSION</a></h1>Return the server version as a float string. Example:<br/><br/><pre class="codeblock python" name="code">
-VERSION
-0.07
-</pre>It is guaranteed that if you compare versions as floats newer versions will be greater than older versions.<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Single line reply</a>
-
- </div>
-
- </div>
- </div>
- </body>
-</html>
-