Web server with Python

Geoff Gerrietts geoff at gerrietts.net
Fri Sep 12 02:24:10 CEST 2003


Quoting Patrick Useldinger (p.useldinger at myrealbox.com):
> Webserver:
> - Medusa
> - Twisted
> - Zope
> Which one is the easiest to work with? Which one is known to work on an
> AIX 5.1 platform, for instance?

Medusa is pretty low-level. It's really just a server framework with
not much in the way of form handling or other niceties.

Zope is pretty high-level. It's at its best in doing content
management, and does a decent job of being an appserver. Its biggest
shortcomings, in my disreputable opinion, are its use of an object
database and its innovative features.

The object database makes it hard to edit stuff except in the web
interface. Several of the innovative features -- security roles, user
authorization, and acquisition to name a few -- make serious,
highly-dynamic development under Zope challenging. You are effectively
learning the intricacies of a highly-evolved application. On the other
hand, if your applications fit into typical categories -- content
management, information publishing, forums, etc -- Zope has lots of
pre-built tools that you can use.

Also, it really depends on how dynamic your "dynamic" is. A friend of
mine runs a job database: not too many writes to the DB and lots of
reads from it, a couple common data types. Zope would be okay for his
stuff. I work on a site where every user submits a profile, and lots
of information is exchanged between users, and every page's content is
entirely different based on the current user's nest of objects. We had
to punch a hole in the side of Zope and we suffer from performance
problems due to the highly dynamic content.

I've looked at Twisted but not used it. It's got some of the low-level
features that Medusa does, but it's also got some of the higher-level
form handling and such that you get out of Zope. It's worth a look.

Also worth a look is WebWare. I've only done a little bit with
WebWare, but it's very similar in architecture and execution to the
Java Servlet API. If I were starting from scratch, that would be my
toolkit of choice for a highly stateful, highly dynamic app.

I can't speak to AIX. You might be the first to try some of these on
those platforms. My advice in those cases is to look at the stuff that
uses as little C code as possible, because gauging portability isn't
too easy.

> Persistent storage
> - Is ZODB easily usable from outside Python, i.e. to produce reports
> without reverting to programming?

No. ZODB is an object database. You put objects in and build your own
indexes to those objects. You get them out the same way you put them
in. ZODB is easily usable from /inside/ Python though: it does not
require you to explicitly handle the object-to-relational mapping that
a SQL database will.

> - Is MySQL with Python a good combination?

I can't comment on MySQL directly, because I've used it only a little
from Python. SQL in general suffers from the difficulty that you need
to write the queries to store and retrieve your objects from the
databse yourself: that process is called object-to-relational mapping,
and it's hard to do well and easy to do in ways you'll regret later.
But, the SQL databases are easily accessible from a quadrillion other
tools that can do reporting for you.

Hope this helps,
--G.

-- 
Geoff Gerrietts                        "I think doorways are sexist."
<geoff at gerrietts net>                           --Jayson Lockwood





More information about the Python-list mailing list