Forum OpenACS Q&A: Response to Article on ACS x Zope

Posted by Jimmie Houchin on
Albert Langer, wrote:
2. For access to RDBMs databases via SQL, Zope provides pretty much exactly the sort of data abstraction facilities that Ben was talking about in:

  This keeps getting confused (at least to me) with the fact that Zope can ALSO use an RDBMs as the "storage" for its OODBMS instead of using an append only flat file. The Zope sql-abstraction facilities are EASIER to use than Tcl and DO NOT require an understanding of ZODB and the core internals of Zope.

3. I still haven't found out how Zope handles connection pooling with external SQL queries.

Jimmie writes:

I believe here is where some of the confusion is. In number 2 above it is mentioned that Zope abstracts out SQL like Ben talks in his article. From my understanding this is not quite accurate. Zope has no SQL. Let me repeat, Zope has no SQL. There is no relational data model in Zope. All SQL and RDBMS development is done solely by the app writer or the user of Zope. All SQL used in Zope is custom for the specific app, for the specific db, by the specific user. Zope has what is called ZSQL methods which are method bindings for queries which integrate the Queries into Zopes object structure and ZODB. It provides some syntactic sugar to make incorporation of a RDBMS into Zope's object world easier. It is very nice, however, I think were talking apples and oranges.

Concerning ZODB's capability of using 'RelationalStorage'. ZODB is Zope's object storage model. It can use a variety of containers to store it's object data. Each storage has different characteristics.

Up to very recently the only usable storage available was FileStorage. It is a single monolithic file. Because of Zope's versioning and undo capabilities a ZODB can growing very rapidly. This is due to store multiple versions of a changed object until the ZODB is packed removing extra versions. On certain filesystems this created a problem due to the 2gb file size limitation. Thus your entire dataset could not exceed 2gb unless you went with a RDBMS to store your data.

A RelationalStorage would help with this, as most RDBMSes get around the 2gb problem. The RelationalStorage is easily abstractable do to the fact that it is creating a single table and storing rows of 8 byte binary data. I could be wrong on this, but this is what I remember. So there is no complex SQL to worry about.

Zope's connection pooling isn't probably any different than AOLservers. You just configure Zope to talk to your db and it'll handle the rest. I believe you can configure threads or handles, but there is not a whole lot to it.

Hopefully this can clear this up some. Zope SQL abstraction and ACS SQL abstraction are two different beast. Zope itself has no SQL to abstract.