Apache DB 드디어 메모리 DB 지원

2009. 7. 14. 09:10Java

어따 써먹을수 있을까 고민좀 해봐야겠습니다.

ㅎㅎㅎ

http://java.sun.com/developer/technicalArticles/Database/javadb_10_5/index.html

The new 10.5.1.1 release of Java DB introduces performance boosts and some exciting features:

  • Scalability. Throughput has gone up significantly for applications that concurrently read and update indexed tables.
  • Large Objects (LOBs). Large binary and text objects stream faster.
  • In-Memory Database. Fast, transient databases can live entirely in memory and vanish when the Java Virtual Machine (JVM)* exits.
  • Generated Columns. Queries run faster because query fragments can be indexed.
  • OFFSET/FETCH. Results can be chunked efficiently.
  • SQL Roles. Fine-grained access control is simpler.

The rest of this article describes the new features: in-memory database, generated columns, OFFSET/FETCH syntax, and SQL roles.

In-Memory Database

Version 10.5.1.1 introduces in-memory databases. Now you can run fast queries against complicated data that disappears when your JVM exits. In-memory databases are great for the following:

  • Caches. Use in-memory Java DB in the middle tier to cache data from enterprise back ends.
  • Monitors. Use in-memory Java DB to aggregate and analyze transient streams of sensor and environmental data.
  • Test rigs. Use in-memory Java DB to plug into test rigs so that laptops can test enterprise applications fast.

Creating an in-memory database is easy. Just add the memory subprotocol to the JDBC connection URL. For instance, if your classpath contains the Derby JAR file (derby.jar), here's how you create a JDBC connection to an in-memory database called patient:

java.sql.Connection conn = java.sql.DriverManager.getConnection( "jdbc:derby:memory:patient;cre