a general question: what are the pros / cons of the two approaches described in the subject?
Say that I have a website with a servlet, and say that each user can store on my server some infos (for example, an agenda). Now, everyone seem to suggest that using some form of database is the approach to follow. What's the bad point about using some plain files, stored somewhere within the servlet? - is a performance issue? - is a "bad practice" problem? - if there are a lot of users, the database will deal with the situation better...
If your design of the information to be stored is still unsettled, go with XML formatted text files. The reason being that XML can evolve MUCH more easily than database tables.
BUT: If you design your user info access interface correctly you will be able to switch from the flexible XML format to the more scalable database format when you finally decide that the evolution of the user info contents is finished.
My big concern is what happens when you go Megalomart and have to cluster your servers. If you've got servers running on three different machines, how does your Servlet keep all those files in sync. At least a database is centralized, and the Transaction API can keep things atomic.
I may be small potatoes, but I'm always thinking big time! Think about scalability.
Joined: May 03, 2006
thank you for your experiences... In principle, anyway, is not a wrong approach using plain files... it can cause problems for big applications...