directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <>
Subject Re: [ApacheDS] Question regarding caching behavior [solved]
Date Fri, 08 Jun 2012 11:50:45 GMT
Le 6/8/12 1:37 PM, Garbage a écrit :
> Am 08.06.2012 um 08:55 schrieb Emmanuel Lécharny<>:
>> Le 6/8/12 6:42 AM, Garbage a écrit :
>>>  From what I know ApacheDS supports caching of search results, that means when
I issue the same search after e.g. one minute the result will be returned from the cache.
>>> First question: is this correct ?
>> No, searches are computed every time you send a request.
>>> Is this something ApacheDS does on it's own or is this the job of the partitions
involved ?
>>> Second question: when implementing a custom partition would I need to take care
of caching on my own ?
>> Atm, yes. We could have implemented a cache on top of partition, but it's not yet
the case (such a cache will keep the entries assuming they have not been updated since their
presence in the cache). This is certainly something we want to have alter, but atm we are
working on stablizing the server itself...
>> -- 
>> Regards,
>> Cordialement,
>> Emmanuel Lécharny
> Thanks, so I know that it makes sense to implement caching in the partition. Just wanted
to make sure that I don't create (at least for now) unnecessary code.

This is not as simple.

There are a few things you might want to cache on a LDAP server, but 
definitively caching entries is a major saver. Now, that raises a few 
concerns :
- how many entries will you cache ? (an entry can be quite large, for 
instance for those entries having a JpegPhot AttributeType)
- how do you ensure the cache concurrency ? You may have many threads 
accessing to this cache, and it requires careful protection against 
concurrent modifications
- At some point, caching an entry might be overkilling : as you will any 
way modify the returned entry, as you'll remove some of the Attrbutes or 
values, you will copy this cached entry anyway (there are other options, 
like not copying the entry, but generate the final result on the fly, 
having gathered the requested Attributes to return, but this can be very 
tricky to implement.

In any case, just try first to get your partiton working before 
implementing some cache :)

Emmanuel Lécharny

View raw message