On May 11, 2009, at 7:17 AM, Daniel Itaborai wrote: > Hi, > > I've never worked with a persistent object system like Durus before. > I think it is quite fascinating(mind blowing, actually. Kudos to you > guys ), but I still have my head too wrapped around the relational > model. I am trying to build a simple application just to learn the > basics of Durus, but everything seems so deceptively simple. I keep > wondering if there is something I'm missing. Welcome. > I keep on hitting walls on things like manual indexing(how and when > to do it), We usually start out using brute-force for searching, and only add indexing later on, when and where it is clearly needed. The indexing we add is either by maintaining separate BTrees or else by using a separate external index file. The external file approach may be better if the indexed items are changing very frequently. > autoincrement ids(should I use them? You might be interested in the Keep class that is in the QP package. We use it for keeping collections of objects with their own id space. Counters that get very frequent change from multiple clients can be a point of conflict. There are ways to get around this, but it is something to be aware of and avoid if it isn't really important to your application. > Should I use oids at the application level?), It is okay to use them for a short-term purpose, but please don't write application code that depends on the values of oids to never change. If a future storage implementation requires a new assignment of oid values, I don't want it to break your application code. For example, don't use oids for hashing in stored mappings. If you need hashing, use some other ids maintained by your application code. > how to deal with large objects, Because Durus compresses pickles, you can keep fairly large objects directly in the database without much trouble. We do this, for example, for email messages in our mail archive. At some size, though, it seems better to keep really large "blobs" in external files, and that is what we do for collections of files that have been uploaded to a site. We just keep the index of the external files in our Durus database. The implementation is in Dulcinea's StoredFile classes. > what is the best way to do more complex searches and so on. I guess it depends on the structure of your objects and their references. > Maybe these are all non-issues and I'm still just too relationaly > biased, but > I haven't been able to find something resembling a "Durus Best > Practices" document or a good code base to study. You might be interested in the QP package and the Dulcinea package. These include some of our application-level code that uses Durus. It would be nice to have a Durus Best Practices document, but it hasn't been written yet.