views:

45

answers:

3
+1  Q: 

cached data base

hi , in my project i need a tow tables each of it has about 2000 row , i want my application to be speed so my db should load into memory (cached) when the app start and before it close the db have to be saved on the disk . i am using java and i want to use sql

+1  A: 

Take a look at SQLite and SqliteJDBC

Be aware though, that 2000rows is by no means large for a DB!

lexu
yes it is not large for db , but still fast than files IO
radi
lexu
yes , but i dont make sure that my db dont get more records by time
radi
+1  A: 

For Java, take a look at H2. It has in-memory databases, is written in Java and should provide the performance you need. Derby or HSQLDB are other Java alternatives.

Rob Heiser
+1  A: 

If the database that you need in memory is mostly read only I would keep a cache in memory but whenever there is a write I would propagate that change directly to the database. This way if the application breaks down you have the current state already in the database.

This should be very simple to write using a Map (or a series of Maps if you need multiple keys to access the data).

rmarimon