Search code examples
guidewire

Cluster-level cache for storing REST service responses with synchronization


I know this is not very specific, but I'd be grateful for any suggestions.

According to the system admin guide, ClaimCenter is fully leveraging the caching mechanism if a user returns to the same server instance across different HTTP requests, but it requires the load balancer to always direct requests to the same ClaimCenter server, and only this enables true horizontal scalability.

Is it possible to configure a cluster-level cache for temporarily storing REST service responses and make it fully-synchronized? That is, is it possible to define a global cache to be used by all servers in a cluster and have the servers broadcasting all new responses to other cluster members immediately after they are computed?

If not, would an instance-specific cache of type LoadingCache<K,V> be enough?


Solution

  • I believe that the caching that each individual node (server) does is only caching the entity beans retrieved from the DB, not the REST responses. Each node has a cache of beans that are either evicted when that bean is updated (by any node, there is communication between the nodes to evict beans when one node updates an entity) or after about 30 minutes when the bean becomes stale (I think the time is configurable).

    I have seen this question a couple of times in the past at clients and the problem is usually that a ClaimCenter portal is calling a ClaimCenter REST API. One of two things usually happens:

    1. The load balancer does not have sticky session enabled so each call to the API goes to a random node which may not have previously loaded beans in the cache because the previous API call went to a different node
    2. The load balancer has sticky session enabled, but it can only see the integration user used by the portal to call the ClaimCenter REST API (The load balancer can't see the portal user credential). This results in every call from the portal being directed to one node by the load balancer. This is also not ideal as it could overload the single node.

    The solution is usually to enable sticky session on the load balancer and ensure the traffic is being split according to the portal user credential, not the integration user that is used to authenticate between the portal and ClaimCenter.

    I think it is certainly possible to create a global cache of some sort that stores REST responses, but I would not recommend it. It is almost certainly something Guidewire would mark as non-conformant and technical debt.

    Hope this helps, if anything isn't applicable to your situation then update your question and I would be happy to update my answer.