gocrud
gocrud copied to clipboard
Suggestion on adding memcached/in-memory db semantically for queries ?
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.
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.