In my spring boot application, I need to implement an in-process multi-level cache Here is an example of the data, which needs to be cached:
customer name (key, string) --data entity name (key, string) --config-1 (value, JSONObject) --config-2 (value, JSONObject)
I'm planning on having a few hundreds customer entries, each having up to a hundred "config" JSONObjects
I'm currently looking at ehcache:
Cache cache = manager.getCache("sampleCache1");
Element element = new Element("key1", "value1");
cache.put(element);
In this context, I would use "Customer_Name" in place of "key1", and "My Customer" in place of "value1", but them I would need to build a hierarchy:
customer
-data entity
-config
I'm not sure how to do it with ehcache. I'm also not sure whether there are better choices for what I'm trying to do.
Has anyone implemented such a multi-level hierarchical cache with ehcache or any other library?