简体   繁体   中英

Is it typical for an enterprise Java Web App to need access to the filesystem?

Most of the Java web application we run in our shop for software development purposes need to have some kind of an APP_HOME directory created where the web application can do work. The applications I am thinking of here are things like Hudson, Nexus, Confluence, JIRA, etc. Perhaps these applications are special because they are for software development (with Confluence perhaps the notable exception).

However, it our own web application we are striving to avoid this requirement and thus saving all the configuration information in a database, whose access can be provided via a JNDI database and/or entity manager factory. NOTE: Our application does NOT have a requirement to do any heavy duty file management.

What are the pros/cons of have an enterprise web application that uses the filesystem for work. Is this typical?

Putting configuration in files makes it easy to put into version control; logging out to files is also pretty darn useful.

File systems are really, really good at storing large blobs of data and providing super fast access and manipulation for them (including fine-grained, byte level manipulation). If you need that, you can wrap the file system storage in a JNDI resource... Using a database for these things may have advantages (backup requirements are crystal clear), but the performance will be quite poor compared to direct file system access. That said, unless your app is actually performance limited by how quickly it can interact with the database for those specific activities, it's probably not worth second guessing yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM