Personal tools
You are here: Home Archive 2005 November 16 Zope in the World of Windows
Document Actions

Zope in the World of Windows

by Alan Runyan last modified November 19, 2005 - 16:16
Filed Under:

Well.. I've come full circle from a Great Plains/COM developer to Java and now Python on Windows. Zope was marginally a second class citizen on Windows -- things are changing...

There has been a lot of movement on Zope and Windows.  Python has some advantages over PHP, Java and Ruby and namely that is of its mature libraries.  I've always told people that for Python to gain mindshare it would be not by its syntax or language features but by its libraries.  In my world that revolves around Mark Hammond pywin32 libraries.

A lot of loving has gone into Zope on win32 over the past year.  Specificially: Ability to rotate log files, clean shutdown, NTFS support in dirstorage and some service enhancements.  Thats pretty unsexy stuff -- but you have to start somewhere.  Some of the other needs would be to set the COM  threading model in zope.conf and in the main zope process; so zope components cant try to change it from one model to another mid-zope flight.

But why is the World of Windows happy go lucky?  Well.  I work at a commercial software company and services firm that specializes in Windows.  So the paycheck aspect is one.  But the real draw for me is the technology potential.  Lets start with Window's basic infrastructure such as consistent services, then work our way up to ODBC and round it out with advance usages such as transactional messaging.

Consistent Services

Its well documented how to setup a service on Windows, even services that depend on other services.  Linux is basically the same across distros (I believe) but OSX, and Solaris are not the same, iirc.  I'm talking about 'canonical' ways of doing things.  After all we *do* care about there being Only One Way To Do It, right?  Windows does offer that.  Services are simple and its very simple to service-fy daemons.  Granted zdaemon is tricky.. twisted is really straightforward.  We use pydirector on windows to load balance across multi zeoclients.  We also set the processor affinity mask for each zeo client binding it to a dedicated process. 


ODBC

Anyone who knows me knows I rant and rave about ZODB.  I have a love/hate relationship.  I fully appreciate its approach and what its trying to do.  It has a lot of use cases.  But Relational Databases make people feel comfortable.  Alot of Zope guru's just dont understand that if a sysadmin can *query* their database with phpMySQL or a command line tool and can SELECT, INSERT, DELETE, UPDATE -- they feel comfortable.  Mainly because SQL is the language they know; Python is easy -- but its not as widespread and familiar as SQL.

Python has lots of database adapters ranging of quality.  Bah.  JDBC has Python wiped.  But since my world runs on Windows and I have ODBC.  eGenix mxODBC and our potential vapor/freeware highperformance ODBC adapter is a single point of entry into *any* ODBC connector on earth.  Write once; interface multiple.  That is powerful.  And I consider it a advantage. 

But having a adapter is not enough.  At Enfold Systems  we recently released a Zope 3 Lab Info Mgmt System called SIP.  SIP uses SQLObject a simple object-relational system.  It does not try to be too transparent.  It does get in your way.  But ya know?  It works.  Its being used by TurboGears and other cool python frameworks.  And thats why I picked it.  SQLObject is a Relational Story and Zope has narrow mindedly rejected SQL - ZSQLMethods in Zope 2 are antiquated technologies.  People expect insta-CRUD forms.  Zope 3 gives us easy pythonic ways to do things (see SIP's usage of SQLObject) but what about Zope 2?  What about Now? 


MSMQ, MTS, IFilter, SSPI, COM, OH MY!

Well in the world of linux you get QT, wx, FUSE, inittab, pam; in the world of Windows we have another batch of abbreviations we have to deal with.  But in the Windows world (like it or not) it comes built-in and accessible by Python via win32com.  Ready to be used with Zope.  Let's take MSMQ -- since it fits my brain and all people who decide technology deployment strategies.  Messaging, such as JMS, MSMQ, Tibco is very powerful.  XMLBlaster is cute.  Spread - I've heard varying success.  MSMSQ - has its downsides but its there. 

Subscribe Zope to a MessageQueue, Foo running in Wisconsin.  Put a message in the Foo queue in Japan.  Its guaranteed to make it to Zope.  These days XML is the linguafranca for messaging and we have grea XML capabilities in Python.  We can send/receive messages to/from any Windows system on the domain.  Its really cool, powerful and has lots of mindshare. 

The same for MSMQ, there are python COM hooks for SSPI, IFilter and a plethora of sophisticated functionality that be exploited from Zope.  Thats what we are doing at Enfold Sysems with Plone.  We want to compete with really large scale systems.  Python, Zope and Windows are are secret sauces. 


Of course, like anything Windows has its downsides; but its a beautiful world.



This raises an interesting larger question

Posted by Jon Stahl at November 17, 2005 - 12:41
There's a lot going on in this post, but I think one of the most interesting themes that deserves more writing & thinking is Plone/SQL database integration. As you point out, there are lots of reasons why developers "feel comfortable" with SQL databases, and also there are some types of data that fit well into simple relational structures.

The current "best practices" for interfacing Plone with SQL databases seem either poorly documented or perhaps non-existent. I would love to hear more thoughts about this from smart developers like you.

SQL and Plone

Posted by Alan Runyan at November 17, 2005 - 13:47
Funny. I just got off the phone with a another Plone/Zope consulting firm talking about this exact thing. SQL storage. Well. Immediately right now SQLStorage in Archetypes is the easiest path forward. But it has limitations. I believe Joel Burton has done a fantastic job in his New Orleans 2003 conference talk discussing the upsides and downsides! But that is only part of the answer. We need the community to give feedback.
There are multiple ways:

- Hornet, http://plone.org/products/hornet

- Archetypes SQLStorage: http://plone.org/documentation/archetypes/ArchetypesDeveloperGuide/index_html#sqlstorage

- APE (adaptable persistent layer)

- ZSQLMethods w/ Zope (doesnt help w/ Plone really)

My favorite:

- Using Plone 2.2 w/ Five and sqlos, http://codespeak.net/z3/sqlos/ (someone is working on this)

- sqlos - http://codespeak.net/svn/z3/sqlos/branch/ivo-3_1-branch/README.txt

In short:

- Lots of ways. Nothing 'canonical'. Someone who wants to head this needs to step up and say not only what the SQL integration will do but most importantly what the SQL integration for Plone *will not* do. If someone does not - I hope for Plone 2.3 or 2.4 to ship with sqlite and for us to start experiments.

Woeful World of SQL

Posted by Alan Runyan at November 17, 2005 - 13:50
Try doing references, multilingual content, versioning, undo and arbitrary schema (Archetypes) in SQL. Yikes! We can do that today using Plone 2.1.1 + LinguaPlone + EnSimpleStaging w/ Archetypes. Some things in SQL are too painful until we work out what we need; its like prototyping algorithms in C, not a good iea. Lets figure out how collaboration adn versioning will work in Plone (evolutionary working-prototype) and then move it to SQL in the future.

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: