[bind10-dev] Blog comment from BDB developer

Danny Mayer mayer at gis.net
Tue Jul 13 02:17:08 UTC 2010


On 6/24/2010 5:49 PM, Shane Kerr wrote:
> Francis,
> 
> On Thu, 2010-06-24 at 18:00 +0000, Francis Dupont wrote:
>>> Best we contact them soon since we need additional functionality from
>>> BDB's C API to walk the zone backward as well as forward once we do a find.
>>
>> => the stupid answer is to create a cursor and to use it to get
>> with DB_NEXT / DB_PREV. Of course this means to set comparison
>> functions before... Now I am not an expert in BDB when a whole
>> group of experts propose their help (:-)!
> 
> The problem with this is that we need the DB_NEXT/DB_PREV for handling
> NXDOMAIN in DNSSEC. But with the C API if you get no match you doing get
> a cursor back, you get a "no data found" return.
> 
> Evan (I think) proposed a brilliant hack of:
> 
>      1. Inserting a data record if no match is found
>      2. Looking up a cursor at that record
>      3. Using DB_PREV to get the covering NSEC value
>      4. Deleting the data record we added
> 
> Clearly this is... sub-optimal. But I'm pretty sure it would work.
> 

You have no idea how bad that would be from a DB performance point of
view. You *really* don't want to do this.

> A better solution would be what Michael alluded to, which is to have a
> lookup which returns "I didn't find the value you wanted, but this is
> the previous/next match in the data we have". We think that the Java API
> provides this functionality, so there should be no fundamental changes
> to BDB to support it.
> 

I've never heard of something like that in Java and I do quite a lot of
Java programming with databases these days. I doubt that this is true.
Databases either find the records requested or not. There's no in
between. You are better off getting the resultset and processing the
records for what you need.

Danny



More information about the bind10-dev mailing list