Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 3537 invoked from network); 10 Jun 2010 06:32:53 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 10 Jun 2010 06:32:53 -0000 Received: (qmail 62474 invoked by uid 500); 10 Jun 2010 06:26:13 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 62359 invoked by uid 500); 10 Jun 2010 06:26:11 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 62351 invoked by uid 99); 10 Jun 2010 06:26:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jun 2010 06:26:10 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.78.103.231] (HELO vorsha.objectstyle.org) (208.78.103.231) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 10 Jun 2010 06:26:02 +0000 Received: (qmail 7678 invoked from network); 10 Jun 2010 06:25:39 -0000 Received: from unknown (HELO ?IPv6:::1?) (127.0.0.1) by localhost with SMTP; 10 Jun 2010 06:25:39 -0000 Message-Id: From: Andrus Adamchik To: user@cayenne.apache.org In-Reply-To: <4C106C8C.7010305@gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Consolidate query and object cache Date: Wed, 9 Jun 2010 23:25:37 -0700 References: <4C106C8C.7010305@gmail.com> X-Mailer: Apple Mail (2.936) X-Virus-Checked: Checked by ClamAV on apache.org I would imagine cache groups will still be in the picture. I can't think of a scaleable cache management API without them. And yes, they do require planning in advanced cases. I am personally using distributed invalidation of cache groups when certain objects are changed. This allows to create custom business rules for partial and targeted cache invalidation with almost no performance overhead (e.g. if (object.createdDate < X) { expire "old_cache_for_entity_x_group" } else { expire "new_cache_for_entity_x_group" }. Pretty flexible, but does require upfront planning. I am still unsure how to reconcile object and query cache at this point. My current direction with that is to place both object and query cache under the same cache storage and management mechanism. But I can't see how we can do automatic invalidation of the right query cache groups efficiently, as any given object change may result in object removal from some lists (when its properties no longer match list fetch conditions) or addition to some others, etc., etc. In fact cache groups mechanism was the answer to the inability to predict how an arbitrary object change affects the cache. If there are better ideas, I'll be happy to hear them. Andrus On Jun 9, 2010, at 9:39 PM, Bob Schellink wrote: > Hi all, > > In the cache docs[1] it mentions there are plans to consolidate the > query and object caches at some > stage. If that happens, would cache groups still be necessary? > > While I find cache groups flexible, it requires quite a bit of > planning and manual configuration to > implement successfully. The problem is further compounded by the > different caches - local vs shared > and object vs query. We've been bitten a number of times where the > query cache isn't cleared when > updating objects. > > Is my assumption correct that if object and query cache is > consolidated, Cayenne would be able to > automatically clear the query cache if an object has changed? > > Kind regards > > Bob > > [1]: http://cayenne.apache.org/doc/caching-and-fresh-data.html >