Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 25458 invoked from network); 6 Feb 2009 13:04:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Feb 2009 13:04:35 -0000 Received: (qmail 79907 invoked by uid 500); 6 Feb 2009 13:04:35 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 79883 invoked by uid 500); 6 Feb 2009 13:04:35 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 79873 invoked by uid 99); 6 Feb 2009 13:04:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Feb 2009 05:04:35 -0800 X-ASF-Spam-Status: No, hits=3.7 required=10.0 tests=DNS_FROM_OPENWHOIS,FORGED_HOTMAIL_RCVD2,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Feb 2009 13:04:27 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LVQNE-00023t-TU for derby-dev@db.apache.org; Fri, 06 Feb 2009 05:04:00 -0800 Message-ID: <21872022.post@talk.nabble.com> Date: Fri, 6 Feb 2009 05:04:00 -0800 (PST) From: DerbyNoob To: derby-dev@db.apache.org Subject: Re: Advantage of Derby Network Server versus Embedded Database In-Reply-To: <7921d3e40902051440v299c9899hc5f252a851a04240@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: thestarchild3@hotmail.com References: <21854157.post@talk.nabble.com> <7921d3e40902051440v299c9899hc5f252a851a04240@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Thank you very much, that was very helpful. My 2 applications are not running in the same JVM, so I am using the Embedded Server mode. Because of SchemaUpdate Problems with Hibernate, I am using 2 different dbs of the Derby Server Instance, instead of using the one database with different schemas. francois.orsini wrote: > > Hi, > > If your 2 applications are running in the same Java Class Loader, then you > can just access the database with one Derby embedded instance. > On the other hand, if your applications are running in different Java > class > loaders, you should start start Derby in Embedded Server mode and then > have > the 2 applications accessing the database with the Derby JDBC Network > Client > driver. > Note that you can also start a Derby instance in embedded mode with the > first application's class loader and then enable remote access (by turning > on Server mode[ > http://db.apache.org/derby/docs/10.4/adminguide/tadminconfig814963.html]) > within that embedded instance to enable the second application to connect > with the client driver. > > Running Derby as a server in a separate process and different host machine > is usually better if the load is already going to be heavy on the > application server (middle-tier) - Trade-off is the network layer > (overhead > due to data marshalling and unmarshalling & network latency) between the > application server and the Derby server if running standalone. Derby > always > runs embedded, the server layer is really the client-server layer that > allows a remote client to connect to a Derby instance. The server layer > can > itself run embedded in some application or as a standalone process... > > So I'd say given your context that it is really a question of trade-off as > far if you can afford to have the database engine running embedded in your > application server, removing the network layer _but_ running in the same > JVM as the app server. > > As I mentioned above, _if_ your applications are running in separate > (dedicated) Java class loaders, then you will need to have Derby's Server > mode enabled so that the second application accesses it via the JDBC > network > client driver in TCP loopback mode. You can't have 2 Derby engine > instances > going after the same database (no DB shared-disk cluster support). > > Also, only having 1 Derby instance to handle mutliple databases only > require > 1 database cache for all DBs. Sorry if I sound like repeating myself but > if > you can have Derby run embedded inside TomCat, then you can have your 2 > applications using the embedded driver to access Derby for both databases > (1 > DB cache) _or_ if they are running in separate class loaders, you could > have > Derby running in embedded server mode and have the second application use > Derby network client driver to access its database. > > Hope this is somehow answering your question. > > --francois > > On Thu, Feb 5, 2009 at 7:51 AM, DerbyNoob > wrote: > >> >> Hi, >> >> I have two java applications starting in one tomcat, with each of them >> using >> a derby database. My question is: >> is there an advantage when using the Network server with 2 databases, or >> is >> it wiser to use 2 embbeded drivers? Are there effincency, performance or >> load advantages when using the server? >> -- >> View this message in context: >> http://www.nabble.com/Advantage-of-Derby-Network-Server-versus-Embedded-Database-tp21854157p21854157.html >> Sent from the Apache Derby Developers mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/Advantage-of-Derby-Network-Server-versus-Embedded-Database-tp21854157p21872022.html Sent from the Apache Derby Developers mailing list archive at Nabble.com.