I naturally optomize for time-domain criticality
I suggest a Sevlet based approach, Connection Pooling is just one of a Coffee Plantation of built-in ( not drop in ) that lends to scalablitiy. In paticular, it is possible to do programmatic approaches ( with Java ) that are traditionally proven using an API that has parallelization exposed to the coder. While some may feel that is not a proveable basis for your design assesment, we can expect that counter-claims would be substantiated with hand-tweaked one-off designs run on powerful racks. Scriplet based approaches are definitely do-able, I have near-zero experience with any scripting language, but I am as of this moment writing a JSP, which amounts to a scriplet that calls a Servlet.
The Servlet is paged in once in Tomcat. There is a call to init() when the code is brought in from persistent register. ( fancy name for disc ) After that, the Server just puts a new Thread on the entry()
and the programming challenge reverses, we have to put synchronized(this) or something in the code as the server will just put new instruction pointers on a pattern of bits and bytes in ram that is already running.
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
What we do to make Logging time efficient is have page ranks, domaing tracking or whatever be passed to a dedicated thread that does nothing but Buffering Logging. It sorta gets mildly sophisticated, traditionally is considered system programming beyond the domain of the every companies' coder, but so-far / so-good ~ I loaded a project in NetBeans a few days ago and the only thing if found in several hundred lines of code was the semicolon I had not removed prototyping my SessionMaster, I had skipped out on short notice to load NetBeans.
Everything I have tried to program in seems to be already coded into Tomcat. I expect they will already have logging running on it's own buffer space.
Just the way I would do it, with stuff I have not thought of yet already working .....
message edit: Java can do NUMEROUS database access protocols. Recently I have begun to think one basis for the design of Java was to provide a uniform call paradigm such that database access could be made better by having a layer between the actual code that calls the db vis-a-vis the coder's view of what is going on. Database everything is all through Java, and as well something like constructing a URL is built in to the Libs,....
I had someone ask me a question about threading recently, when I looked at the code it had a switch that could translate the call to fit any of five or six database call string syntax fomats. These were very common names we hear often.
Java Practices -> Get database connection
Java Database Connectivity - Wikipedia, the free encyclopedia
Java: Database Connection Pooling with Tomcat