How WSO2 API Manager caches work with ditribute mode.

I'm adding small note on cache that helps anyone to understand how cluster caches work in WSO2 API Manager. Please note this is applicable for only WUM updated API Manager 2.1.0 and later versions and API Manager 3.0.0 or later versions by default.

Cache invalidation can happen in the following three ways.
  1. Ones that get synced with other nodes in all cases (add, update, delete)
  2. Ones that get synced with other nodes only on updates & deletes.
  3. Ones that does not get synced with other nodes and only depend on the cache timeout.

We have three types of configs related to this,
a. ForceLocalCache config in carbon xml
Enabling this will do two things,
(i) Change all caches in the server to act as local caches
(II) Enable cache invalidation listener
b. IsDistributed flag in respective cache configs
Setting this value to false will just make that specific cache to act as a local cache.
c. Clustering configuration in axis2.xml
Having clustering enabled with the respective cluster configuration is needed to

When we have ForceLocalCache set as true (If we have ForceLocalCache set as true OOTB) and,
  • when the clustering correctly in place all the caches will work as #2.
  • when the clustering not configured all the caches will work as #3.
When we have ForceLocalCache set as false (Older versions of IS products have the ForceLocalCache set as false OOTB) and,
  • When the clustering correctly in place,
    • For caches marked as IsDistributed true will work as #1
    • For caches marked as IsDistributed false will work as #3
  • When the clustering not configured all the caches will work as #3 regardless of isDistributed true or false.
More details - https://docs.wso2.com/display/IS560/Setting+Up+Deployment+Pattern+1


No comments:

Post a Comment

Empowering the Future of API Management: Unveiling the Journey of WSO2 API Platform for Kubernetes (APK) Project and the Anticipated Alpha Release

  Introduction In the ever-evolving realm of API management, our journey embarked on the APK project eight months ago, and now, with great a...