Return-Path: X-Original-To: apmail-ignite-user-archive@minotaur.apache.org Delivered-To: apmail-ignite-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6DEA817D24 for ; Thu, 24 Sep 2015 17:03:37 +0000 (UTC) Received: (qmail 40575 invoked by uid 500); 24 Sep 2015 17:03:37 -0000 Delivered-To: apmail-ignite-user-archive@ignite.apache.org Received: (qmail 40531 invoked by uid 500); 24 Sep 2015 17:03:37 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 40519 invoked by uid 99); 24 Sep 2015 17:03:37 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Sep 2015 17:03:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id DB7CE1A7EC4 for ; Thu, 24 Sep 2015 17:03:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.001 X-Spam-Level: X-Spam-Status: No, score=0.001 tagged_above=-999 required=6.31 tests=[URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 7bR2f0F9iMoY for ; Thu, 24 Sep 2015 17:03:27 +0000 (UTC) Received: from mbob.nabble.com (mbob.nabble.com [162.253.133.15]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTP id 171FA43A0E for ; Thu, 24 Sep 2015 17:03:27 +0000 (UTC) Received: from malf.nabble.com (unknown [162.253.133.59]) by mbob.nabble.com (Postfix) with ESMTP id 92838164212A for ; Thu, 24 Sep 2015 09:57:39 -0700 (PDT) Date: Thu, 24 Sep 2015 09:56:26 -0700 (PDT) From: kevin To: user@ignite.apache.org Message-ID: <1443113786132-1482.post@n6.nabble.com> In-Reply-To: References: Subject: Re: CacheStore load/get and SQL MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I'm trying to do something similar - run a query (ScanQuery or SqlQuery) against the cache, and would like it to read-through. My use case is this: I store Person and Company objects in Ignite caches. Person objects have the ID of the Company (which is also the key for the Company cache) they belong to. I would like to retrieve the Persons in a given Company. If I run a query against the Person cache (where companyId = x), it would only return the Persons that in the cache. I'm thinking of calling cache.loadCache to read all the Persons for a given Company and caching them, and then calling cache.query(). I would need some strategy to know to only call cache.loadCache when necessary, otherwise there would be a database hit every time I do the query.. which would defeat the purpose of the cache. Unless I always keep every Person in the cache (without evicting/expiring them), then I won't need to call loadCache before the query. An alternative is to have the Company in the cache store a list of IDs of all the Persons belonging to that Company, then I can do a simple key lookup for the Persons, but I would have to maintain that list of IDs in the cache when creating/deleting Persons. Any suggestions to what I'm trying to accomplish? Thanks -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/CacheStore-load-get-and-SQL-tp582p1482.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.