Re: Archtypes SQL Storage

Roché Compaan <roche-kb4xc5yObU3kQYj/0HfcvhBnub05S5/[email protected]> Wed, 11 Oct 2006 13:08:03 +0200
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Organization Upfront Systems
Message-ID <[email protected]>
On Tue, 2006-10-10 at 16:16 -0700, Bill Schindler wrote:
> > I am looking for a way of using the Archetype Content Object only as
> > the View (presentation layer) for easy rendering of the forms and
> > mapping them directly to a relational database without any interference
> > of the ZODB.
> > =

> > Is it possible to modify an Archetype that it looks up the content items
> > completly in the relational database and not first in the zope DB (that
> > maps to the rel. database like in SQLStorage)?
> > I don't see a reason why one should store the same object 2 times in th=
e ZODB and MySQL.
> =

> I'm doing this using zope3/Five formlib to build the view and SQLAlchemy =

> to manage the interaction with the database (PostgreSQL in my case). =

> It's thin and fast, which is exactly what I needed.
> =

> My first attempt used Archetypes. That became excruciatingly slow when =

> we loaded all of the data (many thousands of records). Archetypes is =

> great for a broad range of Plone apps, but when you're dealing with lots =

> of dynamic data, Archetypes is a bad fit.

I think the way SQLStorage is implemented is not optimal, but I do think
it can fixed to easily allow interaction with a RDMBS. As such it is not
an Archetypes deficiency but a SQLStorage one.

If I had to implement this, the first thing that I would do is to create
a folderish class that knows how to retrieve it's content from a
relational database. Using stubs in the ZODB doesn't really scale.

Then I would fix SQLStorage to not use a query for each get and set
operation. This can be done by developing a per object cache of
attribute values, that retrieves and caches state of all attributes on
the first get, is modified during a transaction for set operations and
uses a transaction callback to submit the object's state to the RDBMS in
a single update.

-- =

Roch=E9 Compaan
Upfront Systems                 http://www.upfrontsystems.co.za


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easi=
er
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D1=
21642