Can anyone suggest disadvantages to production use of a database embedded in a servlet container?
Specifically, my team is considering embedding Apache De开发者_开发知识库rby in Tomcat as part of a production deployment, with ease of deployment being the primary motivation. Can anyone suggest any significant disadvantages to this plan? The database will be accessed by two, or potentially three, web apps simultaneously. Initially, the highest number of entries in any one table is predicted to be around the 10,000 mark, though this may increase. Any advice appreciated.
Sounds like an ideal use of Derby to me! Derby is designed to be embedded, and to be easily deployed. The only thing that's a bit complex is the use of multiple web apps. Since each Tomcat web app is a separate class loader instance, they look like multiple independent client apps to Derby, so you'll need to use the Derby client/server connection protocols rather than the Derby embedded protocols when connecting. That is, to use the terminology of http://db.apache.org/derby/docs/10.6/devguide/cdevdvlp96597.html, each Tomcat web app is a separate Derby instance.
In your configuration, you might find it useful to use 'derby.war', the Derby network server packaged as a WAR file. Package that WAR into your Tomcat instance as yet another web app, and use it to manage the Derby server code, then have each of your client web apps connect to it. See http://db.apache.org/derby/docs/10.6/adminguide/cadminservlet98430.html
精彩评论