directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ersin Er" <>
Subject Re: ApacheDS partition implementation based on Relational Model
Date Thu, 02 Nov 2006 15:46:30 GMT

On 11/2/06, Alex Karasulu <> wrote:
> Ersin Er wrote:
> > Hi all,
> >
> > I need some advice on implementing a partition for ADS based on the
> > relational model and using SQL or Hibernate or JPA, or framework like
> > them..
> >
> > First of all, is this realistic? Can we reach a usable result?
> Ok first off you need to better define exactly what you are trying to
> achieve.
> In my mind you might be asking to do 2 separate things:
> 1). Build a generic backend that backs data within a relational database
> using JDBC and has a fixed custom schema for storing and querying LDAP
> data.
> 2). Build a flexible backend that can map any relational database schema
> to an LDAP schema and namespace.  This is more like what is done with a
> virtual directory.
> I will presume below you are referring to #1 and answer your questions.

Yes the first one.

> > How can we map Attributes to SQL model?
> There are probably a few ways to do this but some will be much faster
> however the faster it is the uglier it will be.
> One way is to have one big table with the following columns:
> 1). ENTRY (BLOB)
> 4). ID (INTEGER)
> You can lookup entries that are blobs this way by normalized (NDN) and
> user provided distinguished names (UPDN) as well as by ID.
> If you want to index a specific attribute use some DDL to add a new
> COLUMN to this table.  That column should be the name of the attribute
> being (LDAP not DB) indexed.  Do a full table scan the first time and
> populate this new "index" COLUMN with the values of the attribute.
> Handling queries now is not that complex.  Basically you need to
> determine which attributes you have indices on and which you don't.
> Then do a query to select and narrow down the rows that you'll have to
> resusitate the entry from the blob from.

What if we do not have an index on an attribute? Pull all entries?

> You might need another table for an existance index too.  The EXISTANCE
> table might have a ATTRIBUTE column, and ID column.  If a record exists
> in this table for an attribute your blobed entry then has a value for
> this attribute.
> Should we hold Attribute
> > Values in blobs?
> You will need to hold the entry in a blob.
> > Can we leverage the power of SQL SELECT for LDAP search operations?
> Sure.  You just need to know how to build the WHERE clause of SQL using
> this simple schema.
> > How much of the partition code in ADS can be used for this task?
> Not much.
> Alex

Thanks. Let me move on to other messages on the thread also :)


View raw message