Return-Path: X-Original-To: apmail-directory-users-archive@www.apache.org Delivered-To: apmail-directory-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5A823C94B for ; Fri, 8 Jun 2012 11:51:15 +0000 (UTC) Received: (qmail 54737 invoked by uid 500); 8 Jun 2012 11:51:15 -0000 Delivered-To: apmail-directory-users-archive@directory.apache.org Received: (qmail 54710 invoked by uid 500); 8 Jun 2012 11:51:15 -0000 Mailing-List: contact users-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@directory.apache.org Delivered-To: mailing list users@directory.apache.org Received: (qmail 54702 invoked by uid 99); 8 Jun 2012 11:51:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2012 11:51:15 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of elecharny@gmail.com designates 74.125.83.50 as permitted sender) Received: from [74.125.83.50] (HELO mail-ee0-f50.google.com) (74.125.83.50) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2012 11:51:08 +0000 Received: by eekc13 with SMTP id c13so1373082eek.37 for ; Fri, 08 Jun 2012 04:50:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=xihNXLs+5BaWK9HLvTvN8eXAUnhNx3+4jgeWsv8VKKQ=; b=NjVfiUZOa0qvcfj7wrKWklSOIO1pt0vQ9JfPnRcZO3j1v+7jy6PP8utzM/FSVMItE+ OEO/bLMT7kRl2iCHqo309Tnym0wVy05CCTgSQdng3/z/mvYAL1aciljve6tr9L/PD/tv xxTwpkLcXNJ+DpExfy4Br9OuHki9bCJOh2DjlP5Fvv9RkBNpSgh6GILK6PKDAPSruCUP nbdAxiO+Qv4n1BOMUZ9VIaYaTEC1IoF3ejj747TtmyW6aMJ6b8cOKk8ao017yfja8rOo NmxAurbaSpy8g965LUtBWxWcBpZBbePauIh6Dq6UQt5+fOzwC3BKeDayOCEB8+wdPS8s yI2Q== Received: by 10.14.47.5 with SMTP id s5mr3891070eeb.191.1339156247098; Fri, 08 Jun 2012 04:50:47 -0700 (PDT) Received: from Emmanuels-MacBook-Pro.local (lon92-10-78-226-4-211.fbx.proxad.net. [78.226.4.211]) by mx.google.com with ESMTPS id a16sm21477127eeg.0.2012.06.08.04.50.46 (version=SSLv3 cipher=OTHER); Fri, 08 Jun 2012 04:50:46 -0700 (PDT) Message-ID: <4FD1E715.2080206@gmail.com> Date: Fri, 08 Jun 2012 13:50:45 +0200 From: =?UTF-8?B?RW1tYW51ZWwgTMOpY2hhcm55?= Reply-To: elecharny@apache.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: users@directory.apache.org Subject: Re: [ApacheDS] Question regarding caching behavior [solved] References: <73069D87-FF44-46FA-96F6-A2FD8C19E690@gmx.de> <4FD1A1D1.8050200@gmail.com> <9BC2D065-CDC9-4620-84B4-FC2A6EAE697D@gmx.de> In-Reply-To: <9BC2D065-CDC9-4620-84B4-FC2A6EAE697D@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org 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 >> www.iktek.com >> > 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 :) -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com