Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am looking for a database that is -

  • Relational (Not NoSQL).
  • Has an in-memory store.
  • Has disk-based backing storage.

I want to set up a system where entire contents of the disk are replicated in memory. So writes are made to both the in-memory store and disk, but reads are done only against memory.

Most of the databases I have seen such as H2 or HSQLDB offer in memory grid or disk based tables. I am looking for an in-memory grid WITH disk based backing storage.

Is there such a database system available or is it possible to configure MySQL (or some other) database to work in such a manner?

share|improve this question
    
Looks like premature optimization again. Why do you think you need an in-memory database? –  mustaccio Mar 20 at 18:03

4 Answers 4

Depending on what your requirements are about how it meets your criteria, an Oracle database would apply. If your buffer cache memory area is as large as the database itself then as the data is accessed it would be copied into memory eventually causing most reads to be done in memory. Writes would still go to disk.

You could also consider a RamSan type device that allows memory to behave as a disk. They use disks for their persistent store, which would give you some of the same benefits and allow you to use any database you like.

share|improve this answer

Well, most relational databases will meet those needs as written if your db is small enough to fit in memory. Most have buffer pools for frequently accessed data. This is a common strategy. I know PostgreSQL will do this generally, although it will flush pages from memory to disk and write to the WAL. So if your db fits quite comfortably in memory it all gets managed that way. PostgreSQL uses the 2Q caching algorithm with the OS filesystem buffer as a third tier (writes to the transaction log are flushed on each commit though ensuring durability, but the tables are not).

The big issue though is that this does impose some overhead. You get the standard performance of a good RDBMS. Also managing things in disk format has some penalties. So you won't get something like VoltDB with disk-backed storage. Such a thing doesn't exist because of the translation issues between main memory format and disk-based format.

share|improve this answer

H2 and HSQLDB will cache the tables in memory, even if you use "persistent" tables.

In HSQLDB you can control the amount of memory that is used to hold table data, using the SET FILES CACHE SIZE statement. I think H2 has something similar.

So if you create cached tables and make the data cache large enough you will wind up with tables stored on disk but held in memory.

share|improve this answer
    
What caching strategy is used? –  Kshitiz Sharma Jul 24 '12 at 10:34
    
@KshitizSharma: no idea. You will need to look into the source code or contact the authors directly –  a_horse_with_no_name Jul 24 '12 at 10:39

Yes. ALTIBASE HDB - HybridDB DRAM DB and Disk DM SQL standards compliant, supports all common interfaces, HA, ACID in 1 single unified engine = 1 DB for both.

For Caching difference please see: http://altibase.com/solutions/

For HybridDB product overview see: http://altibase.com/products/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.