Interface CacheManagerBuilder

All Known Implementing Classes:
DefaultCacheManagerBuilder

public interface CacheManagerBuilder
Builder for creating simple CacheManager instances suitable for SINGLE-JVM APPLICATIONS. If your application is deployed (mirrored or clustered) across multiple JVMs, you might not want to use this builder and use your own clusterable CacheManager implementation instead. See Clustering below. Clustering The default CacheManager instances created by this Builder DO NOT SUPPORT CLUSTERING.

If you use this Builder and your application is deployed on multiple JVMs, each of your application instances will have their own local cache of Okta data. Depending on your application requirements, and your cache TTL and TTI settings, this could introduce a significant difference in cached data seen by your application instances, which would likely impact user management behavior. For example, one application instance could see an account as ENABLED, but the other application instance could see it as DISABLED.

For some applications, this discrepancy might be an acceptable trade-off, especially if you configure timeToIdle and timeToLive settings low enough. For example, maybe a TTL of 5 or 10 minutes is an acceptable time to see 'stale' account data. For other applications, this might not be acceptable. If it is acceptable, configuring the timeToIdle and timeToLive settings will allow you to fine-tune how much variance you allow.

However, if you are concerned about this difference in data and you want the Okta SDK's cache to be coherent across your application nodes (typically a good thing to have), it is strongly recommended that you do not use this Builder and instead configure the Okta SDK with a clustered CacheManager implementation of your choosing. This approach still gives you excellent performance improvements and ensures that your cached data is coherent (seen as the same) across all of your application instances.

This comes with an increased cost of course: setting up a caching product and/or cluster. However, this is not much of a problem in practice: most multi-instance applications already leverage caching clusters for their own application needs. In these environments, and with a proper CacheManager implementation leveraging a clustered cache, the Okta Java SDK will live quite happily using this same caching infrastructure.

A coherent cache deployment ensures all of your application instances/nodes can utilize the same cache policy and see the same cached security/identity data. Some example clustered caching solutions: Hazelcast, Ehcache+Terracotta, Memcache, Redis, Coherence, GigaSpaces, etc.

Since:
0.5.0