db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kasper Nielsen <n...@kav.dk>
Subject Re: Using Derby as a binary store
Date Fri, 24 Nov 2006 13:02:26 GMT
Julius.Stroffek wrote:
> Do you need to store them also on a disk?
> Cheers
> Julo

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 

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).


> 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

View raw message