Hacker News new | ask | show | jobs
by stiff 4583 days ago
If Redis would now just use names for databases instead of numbers and get rid of the limit of number of databases... Managing multiple application instances (production, test, staging for multiple countries) using a single shared Redis instance but requiring separate databases is a huge pain.
3 comments

Numbered databases are (de facto) deprecated. Run separate processes, instead.

(Redis is single-threaded, anyways. You probably don't want to run production and staging on the same Redis process.)

Still not a suitable solution IMHO. Now you have to deal with multiple ports, startup scripts etc etc

Every other database on the planet has database names pretty much.

I LOVE Redis but this is just a bonkers limitation IMHO...

None of the reasons why many traditional databases have multi-tenancy support was ever relevant for redis.

And in a world that increasingly moves to containerization you should really look into adding automation to your admin workflow (e.g. ansible). 'port' and 'startup script' should become 'service' and 'template' in your mind.

Now you have to deal with multiple ports, startup scripts etc etc

That's just what happens when you live with production systems. Not every service in the world gives you a dev/staging/production server with "curl github.com/my-bespoke-database/install-and-run.sh"

The last place I worked had 60 physical mysql servers. We had to deal with ports and servers and startup scripts quite a bit.

With tools like Chef, Puppet, Pallet, Ansible, this is a unbelievably solved problem.
I have seen this explanation and frankly I find it ridiculous. Multiple databases as a dictionary layer?
If you have separate stacks for each application instance why wouldn't a separate instance of Redis be part of that stack too? Do you really want some buggy code overloading test-redis and bleeding into production?

More generally, you can always use key-prefixes if you want a name-based way to segregate data in the same redis+db instance.

Along this line I would find named Lua scripts useful, so multiple clients could access script functionality without uploading themselves, or having to retrieve the SHA1 from a dictionary.

This idea may of course be contrary to the expected use of Lua scripts in Redis, and an attempt for the RDBMS part of my brain to look at Lua scripts as stored procedures.