• Post Reply Bookmark Topic Watch Topic
  • New Topic

Suggestion on data storage.  RSS feed

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to store file information in such a way that i should be able to perform add,delete and edit.
file information like path,size,date

sometime i may get same filepath..then i need to modify existing information.

Which is the best option to store information
(a) XML
(b) Database
(c) TreeMap
Any suggestion are most welcome

Thanks in advance.

Kind Regards,
Kotesh.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on the amount of files you have.
For large mount of files, database might be the most efficient.

For a handful of files, in-memory storage and operations make more sense.

Regards,
Jim
 
kotesh rao
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.

Currently I am using TreeMap object to store the information.
But as u said, as the TreeMap Object grows..its taking lot of time for finding, deleting and also for adding new information into object.

finding, adding and deleting from the TreeMap Object is fast..
only problem i am getting is writing the object back to file.
I am using ObjectOutputStream to write the object to file.
Is there any other way to write object fastly to file.

About database I have one query.
I have 5000 records for finding will take long time ?

Thanks
Regards,
Kotesh
 
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have 5000 records for finding will take long time ?

That depends on how you design your data model, how you write your query, if you apply indexes to columns, which database you are using etc. Typically though searching through 5000 records in a good database will a quick operation.

It is very likely to be slower than any in memory route you may currently be using. Why do you believe that using a TreeMap is slow?
[ June 09, 2005: Message edited by: Paul Sturrock ]
 
kotesh rao
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After putting the values in the TreeMap i write the TreeMap Object to file.
so as the TreeMap Object is growing..it taking time to read and write to file.
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is it necessary to write to a file after updating the TreeMap?
 
kotesh rao
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My TreeMap contains all the information..which i need when user logins in again. where should i store the treemap object ?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!