tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Wanted: directory for persistent file storage for webapp
Date Thu, 25 May 2000 13:50:46 GMT

Thanks for your replies. I figured as much, just thought I'd ask in
case there was something I was missing.

On Wed, May 24, 2000 at 04:23:27PM -0700, Craig R. McClanahan wrote:
> wrote:
> > Let's say I have a guest log servlet. Users can come in and write
> > messages; the messages get saved to a file; the servlet loads in the
> > file and displays the content inside itself.
> >
> > Easy, right?
> >
> >
> The standard answer to persistent storage is "use databases, or directory
> servers, or EJBs for stuff like that."

Yeah, I know... Too bad. I don't like databases. I mean, they're great
for what they are, they're just overused. It's an extra...

 - machine to buy (for a good RDBMS like Oracle)
 - process that you have to make sure is running (for a smaller RDBMS like MySQL)
 - language to learn (SQL / PLSQL / etc.)
 - log file to read
 - employee to hire (DBA)

A filesystem is sufficient for 90% of tasks that people use databases
for these days. It's fast, it's simple, it's well understood, and it
never goes down (if the web server is running, so is its hard drive). 

See my article at
for more blatant opinion on the topic.

> If you really want to use disk files (stubborn, aren't we :-), the
> best approach is to use an initialization parameter in the
> deployment descriptor to tell you where the persistent directory is.

Yup, but that's not platform-independent. I mean, it limits the
effectiveness of "plug-and-play" WAR-file webapps.

> The servlet context does provide
> you a context attribute with a work directory
> ("javax.servlet.context.tempdir"), but that is primarily for temporary use --
> there are no guarantees of persistence.

Oh yeah, thanks.  It'd be nice if there were a ".persdir" attribute as
well. How do I submit a request like that to the servlet spec committee?

 - Alex

View raw message