add batch writes in cache.

In this PR, batch writes is added to the in memory cache as mentioned in #182
Do we query any percentiles from UI now? IIRC, we will not call Percentiles() from UI.