[OpenSER-Devel] Re: [OpenSER-Users] New db_berkeley module

William Quan wiquan at employees.org
Thu Oct 11 02:33:22 CEST 2007


Hi Henning,

I was poking around and I don't think the Berkeley DB has indexes like
we're used to in relational databases (or if they do they are not
exposed via api).

So basically each Berkeley DB maps to a SQL 'table'. The 'rows' are
mapped to key/value pairs in the bdb, and 'columns' are
application-encapsulated fields that the module needs to manipulate.
Conceptually its like a big hash table, where you need to know the key
for the query to find a row. Because of this, I did not include the ID
column in the tables, as its the auto incremented column that relational
db would use for an index, not something that is ordinarily provided in
a query by the application. I did not see your xslt file, but could we
modify it to not include the id columns for the berkeleydb stuff?

I use this module for registration so that involves the modules auth_db,
registrar, and usrloc. These modules use primarily tables subscriber and
location.
This stuff has been working for a while, but due to the key definition
of the subscriber and location tables, it does require you to set
use_domain=1 in the script.
I also tested tables acc and version, but the rest remain to be tested.

I should have some more code in the next few days.
-will


Henning Westerholt wrote:
> On Friday 05 October 2007, William Quan wrote:
>   
>> Henning,
>> I'll have to look into indexing the subscriber table, and get back to
>> you on that.
>>     
>
> Hello William,
>
> do you have any update on this topic? The current autogenerated db tables for 
> db_berkeley are not functional at all, the tables that your provides lacks 
> some keys.
>
> Subscriber table in mysql:
>
> PRIMARY KEY id,
> UNIQUE KEY user_id (username, domain),
> KEY username_id (username)
>
> db_berkeley generated from you:
>
> METADATA_KEY
> 0 1 (username, domain)
>
> db_berkeley generated autogenerated:
>
> METADATA_KEY
> 0 1 1 (id, username, username) 
>
>   
>> I can provide some openserctl cmds for the db_berkeley.
>>     
>
> Good, if you have a patch available just submit it to the tracker. Don't 
> hesitate to pester me with questions, if you have some.. :-)
>
>   
>> Aside, there is a new release of BDB  4.6.21 available at:
>> http://www.oracle.com/technology/software/products/berkeley-db/index.html
>> From reading the change log, this version has the fix we need. However,
>> I have yet to verify.
>>     
>
> Great news. At the moment the debian build requires a rather old version that 
> is available in stable.
>
> Cheers,
>
> Henning
>   




More information about the Devel mailing list