When building a web application, what is the norm/best practice when you want to make it as stand-alone as possible? From what I've read, it's considered a very bad idea to just create a /data directory in your web app and use the embedded driver. It looks like there are (my assumptions, probably wrong), only a limited set of options here:
a) Create a /data directory, make sure your web app uses an exploded deployment and then the embedded driver can work against the files in the web apps /data directory
b) Create a /data directory somewhere the web server has read/write privs and use a mechanism to have the web server startup the database prior to your app starting. This assumes network (e.g. local host) connections/drivers.
c) Have the database started and running outside of the web server. This could be a local or remote machine and once again a network connection. However, in my case this would mean a separate java instance (Java database is being used) and the associated memory hit.
I know I've left out other options such as jndi, connection pools, etc. What I'm trying to accomplish (and its my ignorance) is that the web app can be easily deployed and run as self-contained as possible.
What I can say is that the options you left out (JNDI, connection pool etc) are actually the norm/best practices for enterprise applications.
Aiming for a stand alone application is a good thing but it must not be at the expense of the portability which is important in the real world as things change frequently.
So you dont want to embed too much vendor specific stuff in your app that's why you have external conf like JNDI and all...
I hope that makes sense to you
SCJP 5 , SCWCD 5, SCEA 5
Bob Hodges
Greenhorn
Joined: Feb 02, 2007
Posts: 10
posted
0
Ntumba,
Thanks for the reply. It makes perfect sense and thanks for the input. I was over thinking the issue and trying to make it more complex than it is.