Hi all,
ia am searching for a database that enables me to store variable length
binary records in a single file and have random access to them. The
records should be referenced by a key and, if possible, should be
organized in a hierarchie, just like a file system. I do not need any
sophisticated searching techniques in this database.
Does anyone know a good implementation of such a database?
Thanks,
Jo
Erwin Moller - 29 Jan 2004 08:44 GMT
> Hi all,
>
[quoted text clipped - 8 lines]
> Thanks,
> Jo
Hi Jo,
What you want sounds simple enough to do by hand and basic file-io.
Maybe just a single file with three values per line?
Just some CSV-like structure will do.
ID,PATH,BINARYDUMP<newline>
If you make sure your binarydump is encoded some safe way (in this case: no
raw comma's and no newlines) you are ready to go.
Just make a few routines for lookup for ID (SELECT-functionality) and
Insertion of a new record (INSERT-functionality) and DELETE.
The only thing you need is basic file-io to delete a line, or lookup a line.
It will not have great performance, but you have just one simple file.
I guess in most situations I would just prefer a normal database though, but
I don't know your requirements.
Hope this helps,
Regards,
Erwin
Manuel J. Goyenechea - 30 Jan 2004 18:47 GMT
Hello,
Have you looked at Servertec Persistent Object Store, www.servertec.com
Manny
> Hi all,
>
[quoted text clipped - 8 lines]
> Thanks,
> Jo
NOBODY - 02 Feb 2004 03:14 GMT
"J. Passing" <johannes.passing@gmx.net> wrote in news:bv80cl$r4t$1
@zeppelin.rz.uni-potsdam.de:
> Hi all,
>
[quoted text clipped - 8 lines]
> Thanks,
> Jo
You want a cache, a hashmap that swaps to disk or a standard jcache
implementation?
Anyway, you should probably do this:
-write a serializable record class
-write a diskelement class that hold the "long" diskpointer.
-write a diskstore that appends/deletes/manages diskblocks in a file.
All that in a week max.
Or just search for "EHCache".