hapijs / catbox

Multi-strategy object caching service
Other
494 stars 72 forks source link

Add multi-get/set methods for catbox #74

Closed chapel closed 10 years ago

chapel commented 10 years ago

I have been contemplating adding multi-get/set to catbox, since a few of the clients support it natively (memcached, redis, mongo, and technically memory). Ones that don't support it natively can still have the methods, but wrapped with loops and warnings that you shouldn't use these unless you know the potential performance impacts.

My question for @hueniverse and @geek, would you be okay with PRs on catbox and the clients we support for this functionality?

hueniverse commented 10 years ago

Where do you use it that this will be helpful? The main use case is hapi method caching and we can't use it there.

chapel commented 10 years ago

I've been using catbox as a general cache utility, one instance we would like to cache is a list of keys, but the keys change based on the request. We don't want to cache the group of keys as one cache, since it would grow without bounds and with duplicate data, where as we could cache them individually and leverage the capabilities of the engines that support multi-set/get.

I can do this outside of catbox, but it would require either forking or modifying the engine modules regardless.

hueniverse commented 10 years ago

Ignore the above commit. Typo in the title.

hueniverse commented 10 years ago

First, catbox itself will need to detect the multi set/get capabilities and handle when not supported. Should be easy by looking for the prototype method of the engine. Second, this would be a bit tricky to do now that get() and getOrGenerate() are merged into one function. I would suggest to only add multiple set() support for now which should be easy to do. This will remove the need of handling fetching multiple items with different expirations etc.

hueniverse commented 10 years ago

Is this still a thing or can we close it?

chapel commented 10 years ago

Close it thanks. On Oct 3, 2014 11:25 PM, "Eran Hammer" notifications@github.com wrote:

Is this still a thing or can we close it?

— Reply to this email directly or view it on GitHub https://github.com/hapijs/catbox/issues/74#issuecomment-57896255.

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.