[pybsddb] File-like interface for get/put?
David Wolever
wolever at cs.toronto.edu
Thu Aug 14 00:27:53 CEST 2008
On 13-Aug-08, at 2:55 PM, Jesus Cea wrote:
> ...
> Meanwhile, the usual approach would be to break the huge object by
> hand,
> and store each fragment as a separate record in the database. The key
> for the register could be the file offset, using "set_range()" to
> "seek"
> on it when reading. And/or cursors to stream easily and fast (if
> you use
> btree).
Darn, so it's not as simple as flipping a "please work" switch... :P
> You need to be aware of usage patterns to do the right design. A
> read/write approach will be very different to a write once, read many
> environment. Or an append-only configuration. Or a single thread /
> heavily multithreaded application. Berkeley DB Oracle documentation is
> VERY GOOD; read it.
Unfortunately it's also VERY HARD to find :(
(although I did manage to find it)
> I would suggest you to study Durus and my Berkeley DB backend for
> it if
> you really plan to store huge number of objects, or huge objects
> (internally fragmented as several small objects). This provide an
> object
> oriented view, handles object caching, etc.
Ah, great -- this is similar to what I'm doing.
Thanks a lot for the help,
David
More information about the pybsddb
mailing list