[ACCEPTED]-Highest Performance Database in Java-embedded-database

Accepted answer
Score: 12

You could try something like Prevayler (basically 34 an in-memory cache that handles serialization 33 and backup for you so data persists and 32 is transactionally safe). There are other 31 similar projects. I've used it for a large 30 project, it's safe and extremely fast.

If 29 it's the same set of 20,000 objects, or 28 at least not 20,000 new objects every 5 27 seconds but lots of changes, you might be 26 better off cacheing the changes and periodically 25 writing the changes in batch mode (jdbc 24 batch updates are much faster than individual 23 row updates). Depends on whether you need 22 each write to be transactionally wrapped, and 21 whether you'll need a record of the change 20 logs or just aggregate changes.

Edit: as other 19 posts have mentioned Prevayler I thought 18 I'd leave a note on what it does: Basically 17 you create a searchable/serializable object 16 (typically a Map of some sort) which is 15 wrapped in a Prevayler instance, which is 14 serialized to disk. Rather than making changes 13 directly to your map, you make changes by 12 sending your Prevayler instance a serializable 11 record of your change (just an object that 10 contains the change instruction). Prevayler's 9 version of a transaction is to write your 8 serialization changes to disk so that in 7 the event of failure it can load the last 6 complete backup and then replay the changes 5 against that. It's safe, although you do 4 have to have enough memory to load all of 3 your data, and it's a fairly old API, so 2 no generic interfaces, unfortunately. But 1 definitely stable and works as advertised.

Score: 9

I highly recommend H2. This is a kind of 7 "second generation" version of 6 HSQLDB done by one of the original authors. H2 allows 5 us to unit-test our DAO layer without requiring 4 an actual PostgreSQL database, which is 3 awesome.

There is an active net group and mailing 2 list, and the author Thomas Mueller is very 1 responsive to queries (hah, little pun there.)

Score: 7

I don't know if it is the fastest option, but 5 I've been very satisfied with H2 whenever 4 I've used it. It's written by the same 3 person who originally wrote Hypersonic (which 2 later became HSQLDB).

Another option that 1 is allegedly very fast is Prevayler.

Score: 7

It is a bit of an old question, but these 11 days there is a whole lot of databases that 10 have a level of performance of 20,000/s. Which 9 database to chose depends on data structure 8 and type of queries you'd like to be making. It 7 also depends on overall volume.

We had similar 6 problem with large volume of time series 5 data, about 300,000 rec/s and we ended up 4 writing a new database, with simple enough 3 API and decent performance. It can do about 2 2,000,000 object writes/s and we did away 1 without ORM.

It later evolved into QuestDB.

Score: 4

Try the following, it performs really well 1 with Hibernate and other ORM frameworks

http://hsqldb.org/

Score: 4

Chronicle Map is an embeddable pure Java persistent database, providing 6 a simple java.util.Map interface. It withstands about 5 1 million queries/updates per second from a single thread, consistent 4 read/write performance and scales almost 3 linearly to the number of cores in the machine.

Here 2 are some recent performance research with 1 actual numbers:

Score: 3

I would give a try to OrientDB.

0

Score: 2

Terracotta might also be an answer for you. It 2 allows multiple VMs to share objects so 1 you can distribute load etc...

Score: 2

You can also check out db4o

0

Score: 1

If you want to store all of your data in 5 memory, you might want to look at Prevayler.

I've 4 never used it myself, but it seems like 3 a much better solution than using a relational 2 database for those cases in which all of 1 your data can be stored in memory.

Score: 1

hsqldb is quite fast, but it is not ACID 4 transaction-safe. The fastest java-database 3 I know is db4o: benchmarks.

Edit: Please notice that Prevayler 2 is not a database, see http://www.prevayler.org/wiki.jsp?topic=PrevaylerIsNotADatabase. If you're out of 1 RAM, you're out of luck.

Score: 1

Berkeley DB for Java is a fast in memory database, extremely 1 useful for simple object graphs.

Score: 1

H2 is truly fantastic, indeed, in memory, normal 7 server and transactional, you have it all. However 6 It doesn't compare in performance to the 5 object databases, I see Db4o mentioned, I 4 have had much better performance with Neodatis 3 in fact, and everything nicely set up in 2 Maven repositories. Although not very robust, like 1 a Ferrari, fast but not a truck like Oracle.

Score: 0

You can try CSQL (available under open source 6 and enterprise version) It provides 30X 5 performance improvement over disk based 4 database systems and provides JDBC interface. It 3 can be configured to work as stand alone 2 main memory database or as a transparent 1 cache to MySQL, Postgres, Oracle databases.

More Related questions