| Author |
Database vs file
|
Joseph Sweet
Ranch Hand
Joined: Jan 29, 2005
Posts: 327
|
|
Hi guys I need to save a counter that can be updated (quite frequently) from many different servlets, i cannot let the data it holds get lost in case tomcat is shut down, so the only two options i see for that are saving the counter in a database (MySQL) or in a text file. My question is as far as you know, what is faster for opening and writing into, the database or the text file? Thanks, Joseph
|
We must know, we will know. -- David Hilbert
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26216
|
|
Joseph, A text file is likely to be faster. However, databases handle contention better. This may eat away at any time savings from the text file. You could try both to see which works better for you.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: Database vs file
|
|
|