Is there a good in-memory database that would act like DB2 [closed]
Asked Answered
L

7

13

I am currently using DB2 to do unit tests, but it is sometime quite slow. I would need a good in-memory database that would include all the feature of DB2. Does this type of in-memory database exist, or do they only allow standard SQL feature?

Thank you.

EDIT The DB2 Database is on a remote server, so I would need a solution to replicate the schema of that database on a local in-memory database to speed up the tests.

Latia answered 21/9, 2010 at 12:57 Comment(3)
Each database is different. No database -- other than DB2 -- will every have all DB2 features. You can't have "all the feature of DB2" without using DB2. What exact features do you need?Ceuta
There are many applications that are using it, and document all the SQL query within those application would be near impossible.Latia
if you don't know what features you need, then you cannot replace it, can you? If you don't know all the features then no database can ever be used except DB2.Ceuta
S
13

I would need a good in-memory database that would include all the feature of DB2.

Derby (ex Cloudscape) is DB2's language compatible. And it has an in memory mode.

Maybe also have a look at H2 (with the DB2 compatibility mode). But even if H2 would be faster, I would consider Derby in your case.

Shem answered 21/9, 2010 at 13:10 Comment(1)
Derby never supports the Stored Procedure statement, so its not compatible with DB2.Carolinian
R
4

I think the easiest option would be --- DB2.

Download the freebie express edition and install it on your PC. You slow speed is almost certainly down to network bottlenecks and limitations using the DB2 client, installing locally would eliminate these.

The next best thing would be JavaDB (used to be known as Derby!). Which is similar but not quite identical to DB2.

Using any other database will dump you in a quagmire of unsupported features, incompatable SQL, different names for the same function, different functions with the same function name etc.etc.

Rainer answered 23/9, 2010 at 6:25 Comment(0)
F
1

Why not to use tmpfs (Unix), or any conventional ramdrive solution for Windows? Or, you can get a fast SSD.

Fascist answered 21/9, 2010 at 13:1 Comment(1)
The database is on a remote server. So unless I install a DB2 Server on my workstation, this can't be an option.Latia
W
1

As mentioned by Pascal, Derby is almost identical syntactically to DB2. Having tried it for the same thing a while back we had an issue with Derby not supporting sequences, but the connection protocols are identical. Eg you can use the DB2 JDBC driver to connect to a Derby database.

If your application abstracts your database connection with say Hibernate, or NHibernate (if .Net) using H2 or HSQLDB could also work for unit tests assuming you aren't relying on stored procedures and the like.

Another tool that helps out with schema migration that targets multiple DBs is http://liquibase.org . For a test build you make it build your in memory DB and for a deployment you make it build your DB2 database or generate the migration script. It will build the database with the correct schema and offers conditional migrations (eg grant is not available in HSQL so you run the change set for just DB2).

Witherspoon answered 22/9, 2010 at 23:37 Comment(0)
L
0

Having no idea what features DB2 has, but sqlite can create in-memory database. You might want to take a look at it.

Lockman answered 21/9, 2010 at 13:3 Comment(0)
M
0

If you make your bufferpool large enough, your DB2 database will be in-memory, too.

Matthei answered 21/9, 2010 at 16:6 Comment(0)
L
0

Two possible in-memory databases are: - timesTen from Oracle. - SolidDB from IBM. This one could send the transaction back to DB2, but the queries will have a really high performance

For more information about soliddb http://www-01.ibm.com/software/data/soliddb/

Lida answered 23/9, 2010 at 15:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.