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
2010-04-02 18:29:50
yes it is not large for db , but still fast than files IO
radi
2010-04-02 18:41:27
lexu
2010-04-02 18:46:10
yes , but i dont make sure that my db dont get more records by time
radi
2010-04-02 18:53:59
+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
2010-04-02 18:42:51
+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
2010-04-02 19:28:20