ddev-redis icon indicating copy to clipboard operation
ddev-redis copied to clipboard

Valkey as additional service - redis alternative

Open friedinando opened this issue 1 year ago • 4 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Is your feature request related to a problem?

https://www.linuxfoundation.org/press/linux-foundation-launches-open-source-valkey-community

Describe your solution

https://www.drupal.org/project/redis/issues/3443819

Describe alternatives

No response

Additional context

No response

friedinando avatar Nov 08 '24 09:11 friedinando

Hi @friedinando - Why don't you fork https://github.com/ddev/redis and create a new add-on using valkey. I imagine it's pretty straightforward. Another option would be a PR to make valkey an option on the redis PR.

rfay avatar Nov 08 '24 14:11 rfay

I moved this issue to the ddev-redis add-on repo, it's worthy of conversation here.

rfay avatar Nov 08 '24 14:11 rfay

They already have 17k stars https://github.com/valkey-io/valkey, we definitely should support Valkey.

I ran this to see what we have inside, and redis-server is available.

docker run --rm -it --name valkey valkey/valkey bash

We can replace this

https://github.com/ddev/ddev-redis/blob/0147f4170623ded62137a00ca7a62a762ebcef9a/docker-compose.redis.yaml#L5

with:

image: ${REDIS_IMAGE:-redis}:${REDIS_TAG:-6-bullseye} 

and update tests to check if Valkey is going to work.


But this reminds me of https://github.com/ddev/ddev-elasticsearch vs https://github.com/ddev/ddev-opensearch that already have some differences.

What if Valkey implements something new, then it's better to have a new add-on.

stasadev avatar Nov 08 '24 15:11 stasadev

Working on this in:

  • #42

stasadev avatar Apr 25 '25 14:04 stasadev

Hi @stasadev, I just went looking at this.

What is your progress with this and is the approach of a redis-backend the way you are still thinking of steering this out?

For now I will just replace the image myself on an override, but I am too worried if valkey ever forks away from redis drop in replacement, although that will lead to a lot more issues than just this add-on 😄

hanoii avatar May 27 '25 15:05 hanoii

Note: I think that valkey 8 stopped working with a redis.conf file and needs a valkey.conf file, not 100% sure though.

but from https://github.com/search?q=repo%3Avalkey-io%2Fvalkey%20redis.conf&type=code it looks like it

hanoii avatar May 27 '25 15:05 hanoii

Hi @hanoii,

It's ready, but I'm holding off pulling it only because I want to add real-time tests for writing/reading data from Redis. I prepared the manual instructions for Laravel, but we need some automated checks. Recently I broke ddev-redis in the v2.0.0 release, and it was only caught by failing tests on ddev-platformsh, not here.

I'll try to finish the tests this week. Feedback in the meantime is appreciated.

I think that valkey 8 stopped working with a redis.conf file

The filename doesn't matter, as long as it's passed here:

https://github.com/ddev/ddev-redis/blob/5eb87b40c8387445d8207aa700f3845f4a94aabb/docker-compose.redis.yaml#L18

It could be foobar.conf, anything.

stasadev avatar May 27 '25 17:05 stasadev

This is a great improvement, thanks!

I tried to switch to Valkey backend, and everything went well. However, it wasn't clear if I had succeeded. DDEV still seemed to use ddev redis-cli and it said redis:6379> on the CLI ...

But I suppose it has changed, seeing all the valkey mentions after running INFO:

$ ddev redis-cli INFO | grep valkey
server_name:valkey
valkey_version:8.1.4
valkey_release_stage:ga
executable:/data/valkey-server

... compared to Redis as backend:

$ ddev redis-cli
redis:6379> INFO
# Server
redis_version:7.4.6

Could it be indicated somehow, when another backend than Redis is in use, like changing CLI wording to valkey:6379> ... or maybe it's not really possible?

gitressa avatar Oct 30 '25 21:10 gitressa

Could it be indicated somehow, when another backend than Redis is in use, like changing CLI wording to valkey:6379> ... or maybe it's not really possible?

@gitressa, please test:

  • #54

stasadev avatar Nov 01 '25 10:11 stasadev