gocrud icon indicating copy to clipboard operation
gocrud copied to clipboard

Suggestion on adding memcached/in-memory db semantically for queries ?

Open lundin opened this issue 10 years ago • 1 comments

Hi,

I was thinking maybe gocrud should abstract away an easy way for having a a cache for queries, i.e some simple code/line saying enable cache in my app ? Do you think there is a way to create a key from the "execution plan" (i.e identify the incoming query with some params) so one doesn't have to query the ordinary backend to re-create the json but ask the cache first ?

I havent really made my mind up on how to do it, just that it would probably improve things.

lundin avatar Oct 03 '15 00:10 lundin

Hi. Sorry for the delay in replying. It was a long weekend in Australia.

I think the best way to do caching would be to lay it inside data store interface. So, 2 operations: GetEntity and Commit can use memcache before hitting the datastore. Though, the current way this works is that these ops get implemented straight by store drivers; so some sort of extra layer might be needed.

manishrjain avatar Oct 07 '15 23:10 manishrjain