Skip to content

Instantly share code, notes, and snippets.

@djanowski
Created June 25, 2010 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djanowski/452185 to your computer and use it in GitHub Desktop.
Save djanowski/452185 to your computer and use it in GitHub Desktop.
Regarding databases in Redis
============================
The question on named databases and requests for more database-aware
features is a recurrent issue in the Redis community. Salvatore has
explained why using databases is in most cases a bad idea, and thus
expressed that he won't add more features to it.
> I understand how this can be useful, but unfortunately I consider
> Redis multiple database errors my worst decision in Redis design at
> all... without any kind of real gain, it makes the internals a lot
> more complex. The reality is that databases don't scale well for
> a number of reason, like active expire of keys and VM. If the DB
> selection can be performed with a string I can see this feature being
> used as a scalable O(1) dictionary layer, that instead it is not.
>
> With DB numbers, with a default of a few DBs, we are communication
> better what this feature is and how can be used I think. I hope that
> at some point we can drop the multiple DBs support at all, but I think
> it is probably too late as there is a number of people relying on this
> feature for their work.
Bottom line is: if you're using databases to store different kinds of
data, you probably need separate Redis instances.
For a more in-depth explanation by Salvatore, read the following
threads:
http://groups.google.com/group/redis-db/browse_thread/thread/bd2e705fc5f80a38/a53e7f8e2acc8ca3
http://groups.google.com/group/redis-db/browse_thread/thread/dc4908b808ed1d9c/d64ad3a2517ceb77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment