[Zope3-Users] beginning orientation

Lennart Regebro regebro at nuxeo.com
Tue Dec 14 09:29:38 EST 2004


Martin Blais wrote:
> 3. normally i'd use an SQL database or files to store data, but I
> understand that zope includes an object database.  i suppose a trivial
> way to think about this would be to create classes and then each
> "database row" would correspond to an object instance stored in a
> folder (itself corresponding to an SQL table).

No, not at all. A close analogy is a "document" database, like Lotus
Notes, where there are no tables at all, just a database with rows, 
where each row can have completely different datastructure from the 
other rows.

So, there is no hierarchy in the database istelf, just a bunch of 
objects. HOWEVER, some of this objects contain other objects, and that 
way you get a hierarchy of objects.

So, it can be viewed as a hierarchical document database, before you get 
come to grips with object orientation of it.

> will this allow me to run offline processes accessing the data as I
> would an SQL database, say iterating over the object instances and
> then modifying some data in these objects?

Yes.

> is this efficient comparing to a typical MySQL setup?

Typically, no.

> where can i find out more about how to go about this?

Well, you do
   for item in the_list_of_items:
	item.dosomething()

Very easy, really. No complex queries or anything. You just do it in 
python! Tada! :) Getting the_list_of_items can be more complex, but that 
is no generic way of doing that, because it depends on what you want. 
The most generic way is to index everything in a "catalog" and make 
queries on that.

-- 
Lennart Regebro, Nuxeo     http://www.nuxeo.com/
CPS Content Management     http://www.cps-project.org/


More information about the Zope3-users mailing list