Simple local cache that checks by date else get from db
One approach you could pick here is to design your data stores in Storage interfaces in an increasing fashion.



private List&lt;Cab&gt; getCabs(Key key) {
    List&lt;Cab&gt; cabsByKey = this.cache.stream().filter(c -&gt; c.equals(key)).anyMatch();
    if (cabsByKey.isEmpty()) {
       cabsByKey = this.higherStorage.getByKey(key);
    }

    return cabsByKey;
}


The idea is to store its higher level cache instance for each data storage and to propagate request up whenever nothing has been found.