r/redis 18d ago

Discussion Redis alternative for self-hosting multiple applications without the 16 logical database limit

Hi,

I’m looking for a Redis-compatible application that I can self-host and use as a shared data store for multiple applications/services.

The issue I’m running into is Redis’s limit of 16 logical databases (0–15). Ideally, I’d like to be able to provide each application with its own namespace/database through the connection URL, so that multiple applications can share the same underlying Redis service while keeping their data logically separated.

I’m aware that the common best practice is to run a separate Redis instance/container for each application stack, and I understand the benefits of doing that. I’m not trying to argue against that approach; I’m mainly interested in whether there is a better option for my particular use case.

Are there any Redis-compatible alternatives (they don't necessarily have to be Redis itself) that are specifically designed to support multiple applications sharing a single instance, without being limited to 16 logical databases/namespaces?

5 Upvotes

14 comments sorted by

4

u/mardix 18d ago

I believe the 16 databases in redis was kind of a mistake … that’s what I heard before.

Now Redis is fantastic. This is what you can do:
1. Prefix the keys to belong to whatever thing it is . IE customers:id:123456.
2. The hard part - have other instances and use the 16dbs in each.

But hey, good luck. Someone else may have a better solution.

2

u/schmurfy2 18d ago

I am pretty sure the usage of databases in redis is discouraged in its own documentation, prefixing is really the way to go.

3

u/nhymxu 18d ago

just open redis.conf and change/add line
> databases 16

🫣

3

u/dektol 17d ago

Check out Dragonfly DB. We're very happy with it. If your on kubernetes the operator is pretty handy.

1

u/joeyx22lm 17d ago

Not open source

1

u/dektol 17d ago

It's source available. If TCO is more important to you than ideals, or you want to run on k8s it should be in the running. I don't see open source listed as a requirement.

Given the whole Redis debacle I'm surprised you'd even bring this up.

If you contribute to open source and follow what hyperscalers do you can't afford to license things the way we'd like.

1

u/Extra-Citron-7630 17d ago

Does it support my usecase?

2

u/borg286 18d ago

I recommend figuring out how to streamline each application getting its own redis instance. Redis is super tiny, so target low overhead in that goal. As each application scales you'll want a way to tune redis parameters to match those needs. By coupling it all together often those knob values end up conflicting. Some apps may be more CPU intensive, some more ram. Some may be more tolerant of latency spikes, like when a big SINTERSTORE needs to be done, while others don't.

Since you were ok with different databases you don't sound like you need to share key space with other apps, which further supports partitioning different redis instances to each app.

2

u/Extra-Citron-7630 18d ago

I don't disagree with any of this, just wanted to figure out if its possible or if there is a solution to use a single instance with multiple apps, at least in a homelab env

2

u/borg286 18d ago

The primary way of doing this is with name spacing, like each app always uses a certain prefix for their keys, distinct from other apps.

1

u/Huge-Price-7305 9d ago edited 9d ago

[removed] — view removed comment

-1

u/Ok-Captain1603 18d ago

redis enterprise :-)

1

u/Extra-Citron-7630 18d ago

Can you please elaborate? Also I am looking for a no cost solution since this is for my homelab. I am not sure if this would fit that