-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
As a user, I want to use my existing cache infrastructure, e.g., Redis #8423
Comments
Does that mean making proxy-cache support cache infra like redis? |
@tzssangglass Yes, but not only. Because the next requirement will be to support Hazelcast, etc. We need to provide an abstraction layer and a sample provider such as Redis. This way, the community can provide their own. |
Agree +1. After we have such a layer, it can be used in many places. e.g., used in limit-* plugins, x-logger plugins. |
I think we need an additional abstraction, We could define different storages, and then plugins could use them, in a many-to-many relationships. |
I think it should be Cache Storage, it can be Redis, memcached and others. |
I stand by |
+1 |
Look like this feature will turn APISIX into a cache server. I implemented a cache server via Nginx in my previous company, which is not an easy thing to implement. It requires modifying a bundle of Nginx core source, which means it would be a long-term job and need 💰 💰 💰 . Is there any strong demand to support this feature? |
@spacewander I think you misread me: I want Apache APISIX to integrate with storage solutions so we can leverage them. |
No. Using Redis or any other Storage to replace the local filesystem in the proxy-cache plugin is in fact making APISIX closer to a cache server. |
The main point is not whether it is "cache server" or "integrate with storage solutions". The main point is if it is worth doing this job (💰💰💰 ). If we have an infinite budget, we can provide anything people like. But as we don't have one, we need to consider the ROI. |
This is why I seldom say "+1", because I am one of the people who need to think about the budget. |
To make it clear, a strong demand is something like: |
I think you're right, apisix is an opensource project, it should focus on gateway rather than cache. On the other hand, I have a requirement to develop common cache server now. I code a min demo with spring cloud gateway to implement cache server. It has some basic features. like dynamic api config, double cache, cache update strategy etc. now the call link is : client -> apisix(auth) -> cacheServer -> dataApi -> db I want to develop a apisix-plugin to replace cacheServer. I think the difficulty may be to integrate middleware in apisix. Without considering the cost, do you think it's a good idea to implement a better cache-proxy plugin? |
APISIX has a memory-based cache-proxy implementation, contributed by the community. This implementation is done in Lua. However, in our benchmark, the memory-based cache-proxy implementation isn't better than the disk implementation, see #5028 (comment). Even based on the memory, a pure Lua implementation isn't faster than the disk-based C implementation. So if you think a better cache-proxy plugin should work better than squid server or Apache Traffic server, you need to write it as an Nginx C module. In my previous Job in a CDN company, I wrote a cluster-level cache server based on Nginx, which is almost written in C and only exposes some Lua API for configuration. |
On the other hand, if your case is not complex, for example, caching KB-level responses in a Memcache server, a pure Lua implementation may be already enough. The cache server area is complex. It really depends on the size that you need to cache and where you want to put the cache in. |
Thanks your suggests, It's very enlightening for me. |
This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions. |
This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time. |
Description
Most organizations already manage their own caching infrastructure, e.g., Redis, Hazelcast, etc. They know to operate it and may have (paid) support. With Apache APISIX, they need to use the
proxy-cache
plugin, which only provides disk or memory options.As a user, I want to use my existing cache infrastructure to reuse all my know-how.
The text was updated successfully, but these errors were encountered: