aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes cached database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "cached database" Watch "cached database" New topic
Author

cached database

George Fung
Ranch Hand

Joined: Jun 12, 2003
Posts: 98
I have read some posts that implement cached database. Could you tell me what's the machanism of it? Is it necessary? For my case, I always access database file (open file) whenever there is read or update. It may be time consuming and the implementation is simpler than cache database. Any opinion?


SCJP, SCJD, SCWCD, SCBCD, SCEA, SCJP6
To be obtained: SCEA 5
Flemming Mertz
Greenhorn

Joined: Jul 15, 2003
Posts: 11
Hello George
I haven't read the other topics about caching, but I don�t think that a cached database in this case needs to be that difficult to implement. Load all records into some in-memory collection, and then allow all the reads on it, but only write through to the file on actions that update the content. Note, that I am doing the FBN version, so this could be different in your version.
The above mentioned solution could be implemented quite easily, and give you a performance increase. Weather or not performance is an issue, that is the question, then. My assignment states that I should prioritize simplicity, and create code that a junior programmer could understand, over code optimized for performance.
But I think a scheme as outlined above would be simple enough. I do not think that it is necessary for the Developer assignment, however, since the scale of the application wont suffer from a bit of performance penalty. Cached or not cashed, I think both are acceptable. The important thing is to remember to describe your choice, and motivation for it, in the design decisions document.
Regards,
Flemming Mertz
Vlad Rabkin
Ranch Hand

Joined: Jul 07, 2003
Posts: 555
Hi George,
Originally posted by Flemming Mertz:
I think both are acceptable. The important thing is to remember to describe your choice, and motivation for it, in the design decisions document.

I agree. There have been people who apllied one of both design and passed the test.
Best,
Vlad
George Fung
Ranch Hand

Joined: Jun 12, 2003
Posts: 98
I agree with you all.. Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cached database
 
Similar Threads
About reading in records and valid flag
Do we assume the database is used by another application?
Netscape 'location'
NX: When to update cached data
Tomcat not showing the deployed version