kakao / s2graph

This code base is retained for historical interest only, please visit Apache Incubator Repo for latest one
https://github.com/apache/incubator-s2graph
Other
250 stars 32 forks source link

Make Graph to accept user provided Cache implementation. #176

Open SteamShon opened 9 years ago

SteamShon commented 9 years ago

Current implementation only use local cache. it would be better to abstract cache interface and let user to implement their own cache.

for example, if user want to use redis cluster for cache, then by implementing Cache trait, user should be able to use their redis cluster as cache.

I think It would be better to provide Cache trait and only s2core use common cache trait so user can override local cache if they want to use different cache solution.

SteamShon commented 9 years ago

Not quite finished yet.

I think we need to refactor code and change Cache Trait as following.

Key: QueryRequest Value: Seq[QueryResult]

also I think Cache Trait should contains following methods.

  1. get
  2. put
  3. function QueryRequest => Any