Namespaces vs Databases

547 views
Skip to first unread message

Florian Weber

unread,
Aug 5, 2011, 11:29:22 AM8/5/11
to Redis DB
Hi!

In what kinda situation is it recommended to use a different databases
instead
of different namespaces ("users:1234:following", "some_stats:
1312558126:something")?

Thanks

Marc Gravell

unread,
Aug 8, 2011, 6:23:06 AM8/8/11
to redi...@googlegroups.com
I can't speak for "best practice" etc, but here at Stack Exchange we use a different db (via select) for each different *site*. This gives us a simpler management metaphor than having a different **server** per site, but the data is actually isolated. Another scenario would be similar to when using a different DB in a RDBMS : when the data simply doesn't relate.

In particular, in this scenario we want to retain the ability to excise or relocate all data from one system (a db), without having to do a "KEYS" operation. Having a site-related prefix for that a: wouldn't make that possible (or efficient), and b: would make all the keys bigger.

Marc


--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.




--
Regards,

Marc

Carlos Mendes

unread,
Aug 8, 2011, 10:41:46 AM8/8/11
to redi...@googlegroups.com
I've read that multiple databases support could be removed in future versions of Redis and that it won't be supported with Redis Clustering:

I hope to kill the feature at some point in the future. Maybe for
Redis 3.0, but I'm not sure.
Redis Cluster does not support multiple databases.
Salvatore

Could anyone confirm the current plans for this feature?

Marc Gravell

unread,
Aug 8, 2011, 1:12:40 PM8/8/11
to redi...@googlegroups.com, redi...@googlegroups.com
This thread is a similar discussion a little while ago:


Short version - it looks promising it will be retained, but not on clustered.

Marc
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To view this discussion on the web visit https://groups.google.com/d/msg/redis-db/-/ClK5ndfnkY0J.

Carlos Mendes

unread,
Aug 8, 2011, 1:18:10 PM8/8/11
to redi...@googlegroups.com
Thks Marc
Reply all
Reply to author
Forward
0 new messages