On Fri, Nov 16, 2018 at 8:56 PM Stefan Seelmann <[email protected]> wrote:
> On 11/16/18 1:18 PM, Shawn McKinney wrote: > > a. Continue to use the cache, but now have a listener attached to the > data persistence that notifies of change, and triggers a refresh. > > > > b. Remove the cache entirely and just pay for the cost. > > > > I’d say ‘a’ if the complexity and overhead isn’t great other b. > > a) means you have to notify the other Fortress servers about the change, > right? This can be done using some pubsub mechanism but that requires > another component. Or you you want to use LDAP persistent search? I > think both is not strong consisten if that is important. > Persistent search is definitely an option, I think. Fortress will receive all the updates coming from the LDAP server, and update the cache accordingly. Now, that may not be that simple: * consistency: not such a big deal, as soon as the cache is blocked when it's updated. Also remember that there is no strong guarantee that what you get from a LDAP server is up to date, so... * transactions: if some update impact the cache while its data is being used by a fortress client, you may be in trouble (ie, the client may be in trouble). That is something requiring some deep thought. Ideally speaking, Fortress cache could be based on MVCC, so that a fortress client will *always* fetch a consistent version of the data, and that would guarantee that an incoming update will not impact the clients. Moerever, it would allow clients to access the cache without any locking issue. > Maybe another option c) is to use a distributed cache.If I see correctly > Fortress already uses ehcache which also provides a distributed cache, > Terracotta Server, but I'm not sure about the license. There are also > projects at the ASF like Ignite and Commons JCS. Otherwise there are > Memcached or Redis. > Probably overkilling :/ One other possibility: defer complex operation to the LDAP server, instead of procssing it in Fortress. You will be closer to where the data are stored, this will be consistent, and you won't need to manage a cache in Fortress. The drowback is that you will be limited in the servers you can use: only those implementing the operations you would defer. A good way to implement that is trhough extended operation, or in ApacheDS, using storedProcedures (but considering that the SP interceptor may need to be fixed, and also extended to support extended operation, this is a mute possibility, IMHO). -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com
