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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support node-redis, possibly along with ioredis? #368

Open
2 tasks done
yshrsmz opened this issue May 15, 2024 · 2 comments
Open
2 tasks done

Support node-redis, possibly along with ioredis? #368

yshrsmz opened this issue May 15, 2024 · 2 comments

Comments

@yshrsmz
Copy link

yshrsmz commented May 15, 2024

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

馃殌 Feature Proposal

Add support for redis package.

Motivation

According to the issue in ioredis(redis/ioredis#1870 (comment)), the future mainstream package is going to be redis, not ioredis.

So I think it's a good idea to support redis package.

Example

No response

@mcollina
Copy link
Member

Indeed. However Redis is not OSS anymore :'(. I'm generically planning to migrate everything to iovalkey that I plan to maintain.

@yshrsmz
Copy link
Author

yshrsmz commented May 16, 2024

That sounds good!

I'd like to propose another idea. Is it possible to make it more pluggable? I mean, it would be great if we could use any caching mechanism with this plugin.

For example, split the lib into 2(or more) packages. One is @fastify/rate-limit-core, and another is @fastify/rate-limit-ioredis.

@fastify/rate-limit-core provides core fastify plugin implementation and an interface for the caching mechanism, along with its local in-memory implementation. And @fastify/rate-limit-ioredis provides ioredis implementation for the interface.

This way, if we want to use node-redis or any other caching solution, we can develop a custom implementation while using this plugin.

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

No branches or pull requests

2 participants