• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Storing user infos: text files vs database approach

 
Micky Pat
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

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...
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Bill
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Micky Pat
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William, Kameron,



thank you for your experiences...
In principle, anyway, is not a wrong approach using plain files... it can cause problems for big applications...
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic