db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Kendall" <matt_kend...@iname.com>
Subject Share read-only rows across multiple databases
Date Mon, 03 Nov 2008 16:22:51 GMT
I need functionality in Derby that I don't think it currently
provides, so I'm looking to extend Derby to provide it. As part of the
product that I'm working on, I'll be automatically installing Derby
databases in a standalone server mode. Each database will contain one
schema with "shared" data, and multiple user schemas. Each user schema
is expected to be able to union their own data with the read-only
shared data, but no user schema should be able to write to the shared
schema, only their own "private" version of the table.

We have already accomplished this functionality in Oracle 11g using a
combination of views and INSTEAD OF triggers. We have replaced the
tables that contain shared data with views that UNION ALL across a
read-only base table (shared by multiple schema) and a modifiable
table per schema. We then use INSTEAD OF triggers to redirect writes
to the modifiable table. This gives us the effect we are looking for:
Reads from the view transparently merge our read-only and write-able
data while Writes to the view only alter the write-able data. We
understand and accept the performance implications of this approach.

My ultimate goal would be to add INSTEAD OF triggers to derby so that
we would have parity with our Oracle 11g work. However this
requirement is coming in late in the game, so my realistic first pass
will probably be somewhat specific to our product. My hope would be
that I could keep INSTEAD OF functionality in mind during
design/coding and contribute that as a patch during a future revision
of our code.

I've read the architecture documents on the derby site and started to
review the code. It seems to me like I should focus my attention on
the access layer, but I'm not 100% sure. If anyone has any suggestions
as to where I should start reading and understanding the code, or if
there is functionality in derby that I missed that will provide what
I'm looking for, please let me know. Also, any suggestions as to how
we can provide this split-table functionality would be much
appreciated.

Thanks,
Matt Kendall

Mime
View raw message