Joine Music

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Wednesday, 14 March 2007

Sun Tech Days (London): Day 2, Report 2 - Derby DB

Posted on 06:09 by Unknown
Sun Java DB, a Small, Easy to Use, Pure Java RDBMS - Oystein Grolven
[Less than half of the audience have heard about Java DB]

Introduction - Short Intro
What is it? Its the database for Java. For development it should be the natural chioce.

It is a Sun-supported distro of Apache Derby. Same binaries. It turns out that more people in teh audience have heard of Derby. The difference is that Sun provide support. It's bundled with Java SE 6

What are the main characteristics? Its a complete RDBMS engine. It can be embedded (in the same process as your application) or operate in client/server mode. It is designed to be easy to use - "no DBA".

It has a small footprint, is compact and mature and is written in pure Java

History
Originally it was called Cloudscape and was started in 1997(?). Then it was acquired by Informix and subsequently by IBM "where it was silent" but was used in >100 applications from IBM. In 2004 IBM donated Cloudscape to Apache and called it Derby. In 2005 Sun started to add (commit) to it. Today there are 20 developers in Sun working on the Derby project.

It graduated from the incubator (i.e. it had a strong enough community and more than one company behind it) in July 2006. In Deceber 2005 Sun announced Java DB. The current release is 10.2.2 and is bundled in JDK 6.

Within Sun it is used as the default DB in Glassfish, Portal Server and Service Registry as their data storages and is also in tools like Creator and NB.

Features
  • Written in pure Java (therefore runs on the same multiple platforms your app may run on)
  • Write once run anywhere - requires a J2SE 1.3 - Java SE6 VM
  • Database on disk format. I.e. stop the app, copy the db files to a new platform and restart. It all just works again
  • It's embeddable - then access is just a method call within the JVM. It's a single JAR file in your classpath and it is invisible to users and is easy to use with zero maintenance. NOTE: while embedded it can still act as a server
  • Client / Server mode is also possible
  • Small footprint (2MB engine footprint - inc. by ~150k for a network server and another ~200k for tools). Runtime memory cache dependant on app and data caching. It has been run on machies with 16MB memory
  • It's based on standards - SQL and JDBC. There are drivers for JDBC 2.0 - 4.0
  • It also runs on top end mobile phones with the CDC configuration (where it uses a sub set of JDBC defined by JSR 169).
  • It is a complete relational engine - multi user, tx, isolation levels, deadlock detection and crash recovery
  • You can use standard SQL
  • It can be encrypted by using a single Java library
  • It can use Java stored procedures and you may call Java functions from SQL. To call back into the DB engine, use standard SQL connection URL
  • Security - on disk database encryption. Can authenticate vs. an LDAP DB, NIS+ and pluggable authentication. It also provides ANSI grant/revoke priviledges support. Java security manager can be enabled.
  • Architecture: SQL is compiled into byte code and can be optimised by the JIT compiler. The downside is that compilation and class loading has to take place. (therefore prepare and pre compile your statements). There is also a pluggable storage layer - file system (all in a file in a dir.) or read only in a Jar file, or an experimental in-memory version. In the future: HTTP, email, etc.
  • Tools - ij (interactive SQL scripting tool using JDBC), dblook (schema extraction tool which generates the DDL to be used to recreate DB scehma), SQuirreL, sysinfo
Configurations
  • Embedded in the same JVM - easy to use, fast, zero admin. Can only be accessed by one app at a time (though this could be e.g. an app server). To start, there is no specific startup code - when the driver is loaded it starts. [Horiffic syntax though ("Class.forName...") - to be hidden in the DriverManager in SE 7. Shutdown by exiting the JVM. But this is not controlled. You will have to redothe logs from the last checkpoint. Therefore you should do a shutdown with jdbc:derby:[dbname]:shutDown=true; via a connection request. NOTE: This may throw an exception
  • Client / Server - Network server is an added layer between the client and the embedded DB. Stadard protocol (DRDA). Allows you to use scripting.
  • Security - enable user authentication. Might be useful to enable the Java 2 Security Manager. Therefore procedures and fuinctions will have no permissions. App code can be granted permissions.
  • Embedded Network Server - A combination of both. Therefore both network and same-JVM clients can connect. This adds DB reporting and debuging. Done with "derby.drda.startNetworkServer"
  • Read only DB in a JAR - use on e.g. a memory stick. Simple to distribute.
  • DB in a browser - It is small enough to fit in a browser. See demo at http://developers.siun.com/prodetch/javadb. Good it you have AJAX and you can avoid the delay of talking to a server. Then you can synch up periodically. Also copes with browser crashes so you don't lose data
In short it could cover and benefit all three tiers of a Web Application

Performance
It performs well. It compares well to the competition. Comparisions are OK against MySQL and PostgreSQL (with a TPC-B like load , main memory DB, DB 10MB, page cache 50MB not so good, but when DB size inc. to 10Gb, page cache 64MB it tops MySQL)

To Avoid Performance Hits:
  • Use and reuse prepared statements
  • Put the DB log and data on separate disks (specify the logDevice attribute when creating the DB) which avoids the disk head contention
  • Tune the page cache size (the default is 4MB) - derby.storage.pageCacheSize
  • Use indexes to avoid table scans - check query plans with derby.query.logQueryPlan = true;
[Then there is a demo of the tools: ij and SQuirreL]

Features in this (last 10.2 release)
  • XQuery support
Features in next (10.3) release
  • DBA powers
  • Secure Server by default
  • SSL / TLS between client and server
  • Language based ordering
  • Alter table enhancements (drop / rename columns)
  • More performance improvements
  • BLOB / CLOB enhancements - support for the entire JDBC API
Disclosure: I used to work for Sun between 1998 and 2005.
Email ThisBlogThis!Share to XShare to Facebook
Posted in sun tech days java derby database rdbms london | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • (no title)
    The Significance and Importance of Quotes in JSTL EL I just spent a few hours debuggung a null pointer in a Portlet JSP I'm writing. It...
  • (no title)
    Agile Development Ramblings: Part I Introduction I've just completed my first Agile development project. We developed a fully functiona...
  • EJB 3.0 Outside the Container, Inside the JVM - Part 2: Configuring JPA Declaratively
    Welcome to part two of this blog entry introducing using EJB3.0 inside the JVM. Click here to view the first part. As we've seen, JPA ...
  • Reuse (ii): Definition of Done
    As I said in my previous post , our project has suddenly taken a new path. There are two bits of collateral which I'd recently produced...
  • Notes from the FindBugs BOF9231 at JavaOne 2007
    NOTE: These are my incomplete notes from the FindBugs BOF at JavaOne 2007. I got in late due to the crush outside so missed the start of th...
  • Writing Unit Tests to Ensure Your "@Transactional ... rollbackFor" Annotations are Honoured
    Thanks to Russ Hart for providing the info on how to get this to work.  I just cut and paste, and then blogged it. It's nice to write un...
  • (no title)
    Can Your Own Demo I found something great on t'internet the other day. I had been asked to do a demo of our new ystem to some users but...
  • JavaOne Bred Over-Enthusiasm...
    I want to build and fiddle with Wonderland , and my own JDK ! The problem is my graphics card sucks (I need acceleration) and I'm runnin...
  • Booting Apache Derby ("JavaDB") with your Java App's Startup
    If you're embedding the Derby RDBMS with your java desktop application and want it to start when you start your app, you need to make th...
  • STS and RTC – Getting them to Play Nice
    We’re developing our new app using Spring 3.0 RC1 and we want the best tools available. We’ve picked the following: SpringSource Tools ...

Categories

  • 0
  • 2008
  • ant maven pimp build javaone 2008
  • apple ipod touch
  • asm
  • blog new ruby
  • blogtag list
  • bond casinoroyale mashup mi6 film movie
  • build
  • bytecode
  • CI
  • cobertura
  • communityone 2008 nutter jvm scala jruby groovy davinci
  • communityone 2008 opensocial socialsite
  • communityone javaone keynote oreilly
  • configuration
  • cowley
  • css div layout column ie firefox safari example
  • custom
  • darkstar mpk20 wonderland java3d commaboration SL
  • dashboard rss communication news development
  • db2 database SQL max min howto tip
  • db2 database ibm lessons tips
  • db2 database load batch howto example
  • db2 import upload data howto command
  • debt technical java annotation
  • debugging tips javaone 2008
  • development web2.0
  • findbugs JavaOne 2008 pugh
  • findbugs JavaOne BOF notes
  • gafter closures java javaone notes
  • google trouble patriarchal patriarchy
  • groovy metaprogramming javaone 2008
  • grubby oss data generation project announce
  • guice javaone 2008
  • gwt maven howto example simple
  • howto
  • hudson
  • hudson CI javaone 2008
  • ibm
  • invokeDynamic jvm dynamic ruby javaone
  • itinerant web2.0 portable desktop
  • jacl was websphere wsadmin trace logging
  • james gosling sun java open source tech days second life SL
  • jar java manifest properties config howto tip
  • java
  • java applet javaone 2008 reloaded jnlp
  • java javafxscript javaone 2008 fxscript
  • java javaone 2007 07
  • java javaone 2008 bytecode cobertura asm singleton testability
  • javaone
  • javaone keynote gage schwarz javafx
  • javaone semantic web bof notes web3
  • jazz
  • jruby rails javaone charlesnutter thomasenebo
  • jruby ruby netbeans development
  • kill dead laptop computer rebuild restore
  • lessonslearned
  • mac osx java gui shellscript classpath problem solution
  • maven plugin unittest test packager
  • mylin mylar javaone eclipse 2008
  • netbeans development ide
  • netbeans development ide RC
  • netbeans maven2 profiling
  • netbeans ruby sun tech days visual web pack roman strobl
  • ola bini java javaone 2008 thoughtworks ruby jruby
  • openjdk java javaone javafx wonderland
  • overheard
  • pojo ejb3.0 jpa orm java example howto
  • rant
  • rest restful jsr311 java web2.0 javaone ts-6411
  • rome rss feed blog rss atom propono java javaone
  • rsa uml profile plugin howto
  • ruby inheritance example
  • ruby jruby rss xml hpricot
  • ruby unless example
  • scm
  • setup
  • subversion svn xp windows cleanup
  • sun java soa web2.0 netbeans opensource javacaps
  • sun tech days java derby database rdbms london
  • sun tech days london impressions
  • terracotta java javaone 2008 android gwt
  • tip
  • tips
  • vwp netbeans JPA howto
  • was jython scripting nfr ibm pmi jvm
  • was tpv jython scripting nfr ibm pmi
  • webrick ruby jruby actadiurna investigation code howto
  • workitem

Blog Archive

  • ►  2012 (1)
    • ►  October (1)
  • ►  2010 (8)
    • ►  November (1)
    • ►  October (3)
    • ►  June (1)
    • ►  May (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2009 (9)
    • ►  December (1)
    • ►  November (5)
    • ►  March (2)
    • ►  February (1)
  • ►  2008 (22)
    • ►  December (1)
    • ►  November (3)
    • ►  May (15)
    • ►  March (1)
    • ►  January (2)
  • ▼  2007 (53)
    • ►  December (1)
    • ►  November (3)
    • ►  September (3)
    • ►  August (2)
    • ►  July (3)
    • ►  June (1)
    • ►  May (12)
    • ►  April (5)
    • ▼  March (13)
      • Project Acta Diurna - Harnessing RSS Goodness for ...
      • Sun Tech Days (London), Day 2, Report 4 - Extreme ...
      • Sun Tech Days (London): Day 2, Report 3 - Impressions
      • Sun Tech Days (London): Day 2, Report 2 - Derby DB
      • Sun Tech Days (London): Day 2, Report 1 - Gosling ...
      • Sun Tech Days (London): Day 1, Report 1 - First Im...
      • Running JRuby built from the trunk with Netbeans 6.0
      • Placing your config.properties outside your applic...
      • DB2: Show the schema version
      • Ruby with Foxes...
      • Truncating tables in DB2
      • DB2: Finding the maximum / minimum / average valu...
      • Showing a Table's Foreign Keys with DB2 Control Ce...
    • ►  February (7)
    • ►  January (3)
  • ►  2006 (35)
    • ►  December (8)
    • ►  October (1)
    • ►  August (1)
    • ►  July (5)
    • ►  June (8)
    • ►  May (3)
    • ►  April (7)
    • ►  March (2)
Powered by Blogger.

About Me

Unknown
View my complete profile