Skip to content
This repository has been archived by the owner on Jun 22, 2020. It is now read-only.

Provide Result Json LocalCache #207

Open
SteamShon opened this issue Dec 14, 2015 · 2 comments
Open

Provide Result Json LocalCache #207

SteamShon opened this issue Dec 14, 2015 · 2 comments
Assignees

Comments

@SteamShon
Copy link
Contributor

currently s2core provide local cache to reduce I/O requests to storage(HBase). This means even if we hit on cache, we still use lots of cpu to build result json through PostProcess.

many cases, it is beneficial to provide json result cache for data that is not changing dynamically. One example use case is simple mapping table that is not updated frequently. currently, even though we hit on local cache, it is costly to build json result over and over.

I am thinking about provide option on query to specify "ok cache the result json and avoid re-build json over and over".

@SteamShon SteamShon added this to the Code Refactoring milestone Dec 14, 2015
@SteamShon SteamShon self-assigned this Dec 14, 2015
@SteamShon
Copy link
Contributor Author

Currently there is three point that I think cache can help on query path.

Query structure follows below.

Query consists of multiple step, and each step consists of multiple queryParam.

Right now, local cache is only supported on queryParam level. even with hit on cache, we still need to aggregate between other queryParams on same step and filter out.

I am suggesting 3 level caches.

  1. queryParam level cache.
    this cache QueryResult that can be fetched from I/O to storage.
  2. step level cache.
    this cache aggregated and filtered out result after goes through current step.
  3. query level cache.
    this cache final json value.

the faster data set is changing, the lower level of cache would be preferred.

Let me know what others think.

@SteamShon
Copy link
Contributor Author

I was working on this issue and figure out that we don`t need to restrict cache implementation for result cache to local cache. maybe remote cache like memcached or redis can be used for result cache purpose.

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

No branches or pull requests

1 participant