db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Van Couvering <da...@vancouvering.com>
Subject Re: Using Derby as a binary store
Date Mon, 27 Nov 2006 23:50:03 GMT
Ah, I thought it might be the license :)

Well, there have been some rumblings from time to time about making the 
store API public, but so far nothing has come of it.

You say "SQL gets in the way."   How do you know that's the true 
resource consumer for a key/value use of Derby?  It would seem to me 
that if all your tables are basically primary key/data, then all your 
queries would be based on the primary key, and after the first use of 
your prepared statements the resulting compiled queries should be pretty 
darn efficient, especially when those bytecodes get compiled into native 
code by the JIT compiler.

Derby is actually quite fast for basic primary key operations.

I would recommend putting together a performance test and see if your 
concerns are justified (or have you already done this?).   Maybe Derby 
is good enough for your needs...?

David

Kasper Nielsen wrote:
> David Van Couvering wrote:
>> To be honest, this looks more like a job for BDB than for Derby.  I 
>> would love to see the Derby store API made public at some point, but 
>> currently it's not public and I suspect it may be difficult to work 
>> with.  Are there reasons BDB/Java won't work for you?
> 
> Not besides the license:)
> 
> Its for an BSD licensed project, so BDB is pretty much out of the picture.
> 
> And since I haven't been able to find any projects resembling BDB my 
> hope was that I could use Derby with some minor tweaking.
> 
> - Kasper
> 
>> David
>>
>> Kasper Nielsen wrote:
>>> Julius.Stroffek wrote:
>>>> Do you need to store them also on a disk?
>>>>
>>>> Cheers
>>>>
>>>> Julo
>>> Yes,
>>>
>>> I'm only interested in the actual storage/indexing. Any caching I'll 
>>> take of myself.
>>>
>>> Let's for simplicity's sake say I need the following interface in my 
>>> application.
>>>
>>> interface Store {
>>>   void put(byte[] key, byte[] value);
>>>   byte[] get(byte[] key);
>>>   Map<byte[], byte[]> getRange(byte[] key_from, byte[] key_to);
>>> }
>>>
>>> put and get works like the java.util.Map put/get operation.
>>> getRange(83,103) would return all the existing key->value bindings 
>>> for numbers between 83 and 103.
>>>
>>> I could implement this myself, but I would like to use the 
>>> indexing/transactional features of Derby instead. However, I'm not 
>>> willing to pay the performance cost for using SQL since I'm only 
>>> storing byte[] arrays (if it is possible).
>>>
>>> Cheers
>>>   Kasper
>>>
>>>>
>>>> Kasper Nielsen wrote:
>>>>> I'm just looking for a lightweight solution where I can store bytes 
>>>>> (key->value pairs) and create a few indexes on the data.
>>>>>
>>>>>
>>>>> Cheers
>>>>>   Kasper
>>>>>
>>>>>
>>>>>> On 11/24/06, Kasper Nielsen <news@kav.dk> wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I'm evaluating Derby for a project of mine. I really would like

>>>>>>> to avoid
>>>>>>> using SQL and just use Derby as a binary store. Is this possible?
>>>>>>>
>>>>>>> My data consists of key -> value pairs where the keys are
uniformly
>>>>>>> distributed 160 bit numbers and the values are byte arrays.
>>>>>>>
>>>>>>> For now, I need to support 2 basic queries
>>>>>>> * Give me the value mapping for the key K or null if it doesn't

>>>>>>> exist.
>>>>>>> * Give me a map of (key->value)  for the key range of key_start

>>>>>>> to key_end.
>>>>>>>
>>>>>>> I had a look at the org.apache.derby.iap.store packages but 
>>>>>>> wasn't quite
>>>>>>> sure where to start.
>>>>>>>
>>>>>>> Cheers
>>>>>>>   Kasper
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>>
>>
> 
> 

Mime
View raw message