ZODB uses a python technique called pickling.   Just take a piece of the object graph, and squash it into a jar, and save it.  Pickling allows for faster load times.  Google has shown that the web puts a huge premium on load times.  I deal with this by figuring out a tree of objects that display as a page, and load that entire tree in one object references.  In PrivaCV I load a person (11 objects) in two object references.  In Zopache.com I load the whole site of 120 objects (5 classes) as a single object reference.  One could Pickle objects in PostgreSQL, but then one looses the ability to access their fields outside of Python.   And of course modifying the graph is so easy in ZODB. 

Fast Loading

In PostgreSQL each schema type is stored in its own files with its own index,  and every record is accessed separately.  In ZODB,  a single pickle can include many differetnt classes.  Pickles load fast, as a single object access.   In contrast. accessing objects with multiple schemas in Postgress requires accessing multiple files. That is slower.  In practice, to minimize load times,  PostgreSQL developers self-limit the complexity of schemas, making applications  more brittle.   

Dynamic Schemas

But Pickling offers more than just fast loading.  It offers dynamic schemas.   Postgress schemas are relatively static.  Pickles can be far more dynamic.   In PostgreSQL every schema has its own definition, and files.  I believe that you can subclass schemas but that generates a new set of files and indexes.  In PrivaCV every person has a custom skill object, with many different parent (Z)Classes.  The user chooses the skills, that defines their custom skill class.   I have a hundred skills, soon to be a thousand skills. Imagine how many PostgreSQL schemas that would require.  Every PrivaCV person skill object is a single object, part of a larger pickle, and loads in a single object access, no matter how many  specific skills in inherits from.  

I invite you to Register and then link to your own blog postings and software packages..

Powered by Zopache, Grok, Zope and ZODB

Robots Crawl This