Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id C56FD9F9522 for ; Thu, 6 Sep 2007 09:16:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 28439-05 for ; Thu, 6 Sep 2007 09:16:11 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from gmp-eb-mail-1.sun.com (gmp-eb-mail-1.eu.sun.com [192.18.6.21]) by postgresql.org (Postfix) with ESMTP id 62F529F94A2 for ; Thu, 6 Sep 2007 09:16:20 -0300 (ADT) Received: from fe-emea-10.sun.com (gmp-eb-lb-2-fe3.eu.sun.com [192.18.6.12]) by gmp-eb-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id l86CGIII010922 for ; Thu, 6 Sep 2007 12:16:18 GMT Received: from conversion-daemon.fe-emea-10.sun.com by fe-emea-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0JNY00L0139WB100@fe-emea-10.sun.com> (original mail from Paul.Vandenbogaard@Sun.COM) for pgsql-jdbc@postgresql.org; Thu, 06 Sep 2007 13:16:18 +0100 (BST) Received: from [192.168.0.250] ([81.69.7.254]) by fe-emea-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0JNY00IUP4R05M60@fe-emea-10.sun.com>; Thu, 06 Sep 2007 13:16:14 +0100 (BST) Date: Thu, 06 Sep 2007 14:16:34 +0200 From: Paul van den Bogaard Subject: Re: Caching driver on pgFoundry? In-reply-to: <46DFCB12.4080605@opencloud.com> To: Oliver Jowett Cc: Kris Jurka , Dave Cramer , Josh Berkus , Heikki Linnakangas , pgsql-jdbc@postgresql.org Message-id: MIME-version: 1.0 X-Mailer: Apple Mail (2.752.3) Content-type: text/plain; format=flowed; delsp=yes; charset=US-ASCII Content-transfer-encoding: 7BIT References: <200709050825.27080.josh@agliodbs.com> <200709050911.09478.josh@agliodbs.com> <46DED76E.9050706@enterprisedb.com> <200709050937.29027.josh@agliodbs.com> <8FD2948B-9513-4611-9310-908CA253EECD@fastcrypt.com> <159CA908-A763-4FB0-824F-8DCF3A3DD22C@fastcrypt.com> <46DFC4ED.607@opencloud.com> <956CBA7B-8B02-4EFD-BAD1-99107E4A7242@Sun.COM> <46DFCB12.4080605@opencloud.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/55 X-Sequence-Number: 17477 On 6-sep-2007, at 11:40, Oliver Jowett wrote: > Paul van den Bogaard wrote: > >> For the ones you describe could it be that the dbase layer is just >> storage and not part of the (critical) performance path? > > Right, in our case we keep all state in memory as the primary > representation (and maybe replicated across a cluster) and some > specific state is also asynchronously written to disk via a RDBMS > so that it survives a cluster restart. Performance of the write- > back step is still important as it affects things like our MTTR > from a complete database+cluster failure, but it does not directly > affect the call throughput / latency. > >> If the database related work is critical in performance/throughput >> than caching is a welcome technology. > > Well no not necessarily because *statement caching does nothing > that you can't do directly in your application anyway*. For example > in our case we would get no additional benefit from statement > caching because we (as a JDBC client) already hold on to statement > objects that we know we're going to reuse, i.e. we're already doing > our own caching, and smarter than a generic layer can do because we > have better knowledge of how we use our queries. If all ISVs would do it intelligently than I would have been out of a job :-). I definitely agree. There is only one who can (should) know best and that is the application writer. However I found this is a rare situation. On the other hand if you do not need this most optimal situation than indeed it would be very helpfull if this layer in between would do it for you. > > Statement caching is really a "go faster" switch when you don't > want to (or cannot) optimize the application code, or where the > exact query strings are unpredictable. But again it's not something > that *has* to be implemented in the driver, as far as I can tell > there's nothing there that can't be done by a layer between the > client and the real driver. I think from an implementation point of view you can build in and/or directly on top the JDBC layer. From a performance point of view I do not expect a significant advantage for one or the other either. --Paul > > -O ------------------------------------------------------------------------ --------------------- Paul van den Bogaard Paul.vandenBogaard@sun.com CIE -- Collaboration and ISV Engineering, Opensource Engineering group Sun Microsystems, Inc phone: +31 334 515 918 Saturnus 1 extentsion: x (70)15918 3824 ME Amersfoort mobile: +31 651 913 354 The Netherlands fax: +31 334 515 001