[Dev] ZODB is not a Storage Technology (Re: other formats )

Michael R. Bernstein webmaven at lvcm.com
Sun Nov 3 12:16:33 PST 2002


On Sat, 2002-11-02 at 23:57, David McCusker wrote:
>
> Eric Gerlach wrote: [ snip ]
>
> > Making alternative storage methods possible needs to be something
> > that happens within the Model of the MVC pattern.  To allow for
> > multiple storage technologies, one has to make another layer (which I
> > would recommend, if only so that the storage layer could be used in
> > other apps.)
> 
> Yeah, that makes sense. While models don't depend on views in MVC,
> the views do depend on models, so it's up to a model not to commit to
> a single storage technology making views interact with a storage API.
> 
> > A lovely ASCII art rendition of my thoughts (may look wrong if you
> > don't use a mono-spaced font):
> > 
> >        +---->User----+
> >        |             |
> >        |             v
> >      View       Controller
> >        ^             |
> >        |             |
> > +------|--+-----+----|--------+
> > |      |  |Model|    |        |
> > |      |  +-----+    |        |
> > |      |             v        |
> > |     Manipulation Layer      |
> > |        ^         |          |
> > |        |         v          |
> > |       Storage Layer         |
> > |        ^         |          |
> > +--------|---------|----------+
> >          |         |
> >          +- Data <-+
> 
> That's a nice diagram.  I'm generally in favor of more layers, when
> each layer acts to protect code on both sides of the boundary from
> depending on each other overly much.  The performance impact of extra
> layers is generally neglible as long as there are not many layers, and
> as long as copying doesn't happen heavily at each layer boundary.

The ZODB is not in and of itself a Storage technology. It is a Python
object persistence layer, that has a pluggable storage back-end.

Here is the diagram modified to take account of how the ZODB works:

       ~             ~
+------|--+-----+----|-------+
|      |  |Model|    |       |
|      |  +-----+    |       |
|      |             v       |
|     Manipulation Layer     |
|        ^         |         |
|        |         v         |
|  Object Persistence Layer  |
|        ^         |         |
|        |         v         |
|       Storage Layer        |
+--------^---------|---------+
         |         |
+--------|+-------+|---------+
|        ||Storage||         |
|        |+-------+|         |
|        |         |         |
|        +- Data <-+         |
+----------------------------+

Currently, I understand the Storage selected as the ZODB back-end for
Chandler is the Berkely DB, but ZODB has other storages available, and
it's certainly possible to create more.

All the ZODB really cares about is transparently persisting Python
objects and their attributes. 

Michael Bernstein.




More information about the Dev mailing list