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.
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).
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
发布评论
评论(7)
Derby(前 Cloudscape)与 DB2 的语言兼容。它有一个内存模式。
也许还可以看看 H2(使用 DB2 兼容模式)。但即使 H2 会更快,我也会考虑你的情况德比。
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.
我认为最简单的选择是——DB2。
下载免费快速版并将其安装在您的电脑上。速度慢几乎肯定是由于网络瓶颈和使用 DB2 客户端的限制造成的,本地安装可以消除这些问题。
下一个最好的东西是 JavaDB(以前称为 Derby!)。它与 DB2 类似但不完全相同。
使用任何其他数据库都会使您陷入不支持的功能、不兼容的 SQL、同一函数的不同名称、具有相同函数名称的不同函数等的泥潭。
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.
为什么不使用 tmpfs (Unix) 或任何适用于 Windows 的传统 ramdrive 解决方案?
或者,您可以获得快速 SSD。
Why not to use tmpfs (Unix), or any conventional ramdrive solution for Windows?
Or, you can get a fast SSD.
正如 Pascal 所提到的,Derby 在语法上与 DB2 几乎相同。不久前尝试过同样的事情,我们遇到了 Derby 不支持序列的问题,但连接协议是相同的。例如,您可以使用 DB2 JDBC 驱动程序连接到 Derby 数据库。
如果您的应用程序使用 Hibernate 或 NHibernate(如果是 .Net)抽象您的数据库连接,则使用 H2 或 HSQLDB 也可以用于单元测试,假设您不依赖存储过程等。
另一个有助于针对多个数据库进行架构迁移的工具是 http://liquibase.org 。对于测试构建,您可以让它构建您的内存数据库;对于部署,您可以让它构建您的 DB2 数据库或生成迁移脚本。它将使用正确的模式构建数据库并提供条件迁移(例如,授权在 HSQL 中不可用,因此您只为 DB2 运行更改集)。
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).
不知道 DB2 有什么功能,但 sqlite 可以创建内存数据库。您可能想看一下。
Having no idea what features DB2 has, but sqlite can create in-memory database. You might want to take a look at it.
如果您的缓冲池足够大,您的 DB2 数据库也将位于内存中。
If you make your bufferpool large enough, your DB2 database will be in-memory, too.
两种可能的内存数据库是:
- Oracle 的 timesTen。
- 来自 IBM 的 SolidDB。这个可以将事务发送回 DB2,但查询将具有非常高的性能。
有关soliddb 的更多信息 http://www-01.ibm.com/software/data/soliddb/
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/