Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move from redis to valkey #843

Merged
merged 3 commits into from
Jan 14, 2025
Merged

Move from redis to valkey #843

merged 3 commits into from
Jan 14, 2025

Conversation

jcscottiii
Copy link
Collaborator

@jcscottiii jcscottiii commented Oct 29, 2024

Our code uses an Cache interface so we just need to implement another implementation of the cache interface for valkey.

Most of the work is renaming everything from redis to valkey.

The tests that use an actual instance in lib/valkeycache/cache_test.go needed no modifications besides renaming.

With this, we can use the latest version of valkey: 8.0. Whereas it seems we are stuck on redis version 7.2 beforehand (redis has 7.4 out).

One thing that is notable, the valkey client uses strings and []byte. We tend to like []byte instead. So what I did was restrict this implementation to []byte values.

From a Terraform perspective, I just followed the examples from the docs. Previously, we had a 1GB instance. Now, we have a 1.4GB instance (via the SHARED_CORE_NANO node type). That is the smallest instance type. Pricing wise shouldn't really matter. The instance will be slightly cheaper (4 cents per hour vs 6 cents per hour). Valkey Pricing vs Redis Pricing. I think the network pricing will be the same based on usage.

@jcscottiii jcscottiii force-pushed the valkey branch 2 times, most recently from 04ed6ee to 5f1c016 Compare October 29, 2024 20:46
infra/storage/valkey.tf Outdated Show resolved Hide resolved
Our code uses an Cache interface so we just need to implement another implementation of the cache interface for valkey.
@jcscottiii jcscottiii marked this pull request as ready for review January 14, 2025 21:42
Copy link
Collaborator

@jrobbins jrobbins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, where can we see our cache hit ratio?

@jcscottiii
Copy link
Collaborator Author

Just curious, where can we see our cache hit ratio?

For Valkey, it appears in the monitoring tab of that particular instance: Here's an example.

image

For redis, it appears on the monitoring tab of that particular instance too: Here's an example

image

On a semi-related note:

The Redis dashboard by default has some more interesting charts like expired & evicted keys. I would check those out too. Valkey has those metrics but we just have to add the charts ourselves (I will add them to the existing main dashboard)

@jcscottiii jcscottiii added this pull request to the merge queue Jan 14, 2025
Merged via the queue into main with commit 25dd60e Jan 14, 2025
6 checks passed
@jcscottiii jcscottiii deleted the valkey branch January 14, 2025 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants