ApacheCon demo - Web Browser Client Offline Storage with Java DB / Apache Derby
By forsini on Dec 14, 2005
What I demo'ed at Apache during Tim Bray's keynotes was one particular use case of embedded Apache Derby (100% pure Java RDBMS) running within a web browser such as Mozilla Firefox...This allowed me to persist data automatically as HTML FORM fields got changed (at the field level or not) - It autosaved data entries locally without being paranoid about loosing my data in case of a browser crash or bad manipulation (fat fingers anyone?)...The store service can be called at anytime really from your client script...
Various database systems excel at different types of needs...My intent here was to use Apache Derby as the repository for an application managing some user's personal data (i.e. personal/private/financial taxes info). This is very different than managing browser's data/metadata (i.e. bookmarks, history, cache, etc) at the low-level and where indeed I would need a closer integration of the RDBMS with the browser engine...The demo highlighted how a web application could be enhanced (fast, embedded and secure local SQL storage) across web browsers, not just how it could enhance a particular web browser (i.e. Firefox).
As this particular demo manages personal and financial data, it is very likely that a production application would want to encrypt the data stored on the client storage - This is a possible and very likely an application requirement for this type of webapps. Derby supports strong encryption at the database level as well as strong authentication at the Derby engine or/and database level. Hence, I can have my local derby database(s) be secure, portable and platform independent without having to worry if I loose my usb drive or stick and my DB is on it...Derby also has some ACL-light support for embedded type of apps but Ansi SQL Grant & Revoke is being implemented as we speak - this is independent of the OS FS file permission scheme and is portable across OS's.
For the Java engine I used Sun's JRE (browser Java plugin) which is a one-click install and is portable across and widely known web browsers.
Requirements for this Webapp demo were:
- A fast, embeddable, portable and secure (authentication/authorization/encryption) local client storage engine
- Portable across most widely known web browsers (at least 2 of them)
- Support for scripting standard asynchronous requests (Ajax mode) to the embedded client data store
- Various deployment options for the web application and database engine
- Support for direct access via a client scripting engine (non-Ajax mode, ala LiveConnect)
The deployment options for the ClientStorage engine and service would be:
- Direct HTTP download and archival of JARs,
- Direct copy of files,
- Firefox extension (w/ a dependence on the J2SE runtime environment Firefox plugin)
- Web shipping of already pre-populated databases, then made available locally to the web browser.
You can read all the details about this demo and get the source code at:
Thanks for reading...