Setting Up Custom Centralized Cache

There are a few steps to getting started with your own centralized cache.

Firstly, you will need to setup your data store. This can be locally or on your server cluster, if you have one. Some data stores that we considered before picking Couchbase are Redis, Cassandra, and Memcached.

Then, you will need to add the client for your data source to ThirdEye’s build. For the most part, this can be done by adding the client package’s info to pom.xml for Maven.

Lastly, you will need to make your own DAO class. ThirdEye provides an interface for users who want to use their own data store of choice. This is the CacheDAO interface.

The CacheDAO interface has two methods:

ThirdEyeCacheResponse tryFetchExistingTimeSeries(ThirdEyeCacheRequest request) throws Exception;
void insertTimeSeriesDataPoint(TimeSeriesDataPoint point);

Your DAO will need to implement these methods, and handle connections to your centralized cache. Also keep performance in mind, and you may need to design your own document schema. The schema that ThirdEye uses for Couchbase can be found in the code in the CouchbaseCacheDAO class.