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

Memcached-backed cache location? #46

Open
valentijnvenus opened this issue Sep 9, 2019 · 13 comments
Open

Memcached-backed cache location? #46

valentijnvenus opened this issue Sep 9, 2019 · 13 comments

Comments

@valentijnvenus
Copy link

This is a FEATURE request:

Instead of using Nuster's cache (in-memory or disk persistent solutions), would you have any pointers if Memcached is to be used?

e.g.:
nuster cache on data-size 10m memcached address:11211

We might be able to contribute.

@jiangwenyuan
Copy link
Owner

Hi, there's no plan to add support for memcached backed persistence, but the contribution is welcomed:)

@AndreiG6
Copy link

AndreiG6 commented Sep 9, 2019

If anything redis would be better considering it can store in both ram and disk

@valentijnvenus
Copy link
Author

valentijnvenus commented Sep 10, 2019

Is redis compatible with the memcache-protocol? If so, one could use any stack as long as it is compliant, e.g. incl. couchbase.

@jiangwenyuan any pointers to the c-code you'd suggest studying in more detail?

@jiangwenyuan
Copy link
Owner

@valentijnvenus Just out of curiosity, why do you need memcached-backed persistence?

Here's some code you might need to look into

https://github.com/jiangwenyuan/nuster/blob/master/include/nuster/nuster.h#L57 for parse nuster in global section

https://github.com/jiangwenyuan/nuster/blob/master/src/nuster/parser.c#L880 for parse nuster rule

https://github.com/jiangwenyuan/nuster/blob/master/src/nuster/cache/filter.c#L116 the entry of request/response, checking key existence

https://github.com/jiangwenyuan/nuster/blob/master/src/nuster/cache/filter.c#L290 caching data

etc

@packeteer
Copy link

packeteer commented Dec 23, 2019

@valentijnvenus Just out of curiosity, why do you need memcached-backed persistence?

It would be good to have the ability to use Nuster in a cluster setup ie. replicate data to other nodes.
In my use case, I split the traffic 3 ways (for redundancy and load balancing) before it even hits Nuster, which dilutes the effectiveness of any caching

@valentijnvenus
Copy link
Author

valentijnvenus commented Dec 24, 2019 via email

@packeteer
Copy link

packeteer commented May 20, 2020

fwiw, I think something like ZeroMQ or NNG might be a better fit for this
https://zeromq.org/
https://nng.nanomsg.org/

@jiangwenyuan
Copy link
Owner

iiuc, ZeroMQ is a message queue, how can we find data by key in such system?

BTW, I'm working on using redis as 3rd backend store.

@packeteer
Copy link

packeteer commented May 20, 2020

oh ok, I was thinking the service would only be used to transfer content between running processes, not used as a backend.
maybe my misunderstanding of Nuster internals?

@jiangwenyuan
Copy link
Owner

I see, do you mean use that as a sync mechanism?

@packeteer
Copy link

yes, exactly

@jiangwenyuan
Copy link
Owner

Interesting, thanks for the info:) I would evaluate that along with haproxy peers an other options.

@igorescobar
Copy link

Redis would be a better start in my opinion.

Screenshot 2020-05-23 at 16 17 17

Interest worldwide - last 5 years - Memcached (blue), Redis (Red):
Screenshot 2020-05-23 at 16 19 09

So if you want to start somewhere I would bet on the right horse 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants