[Zope-dev] A modest proposal: Replace medusa with Twisted

kosh@aesaeion.com kosh@aesaeion.com
Wed, 10 Oct 2001 05:05:08 -0600 (MDT)


Designing the webpages of tomorrow http://webme-eng.com
Designing the MMORPGS of tomorrow http://worldforge.org

On Wed, 10 Oct 2001, Itamar Shtull-Trauring wrote:

> Actually, this brings up this idea I had - Zope should replace medusa with
> Twisted. Why, you ask?
>
Any ideas what the performance would be compared to medusa?

> 1) Twisted separates transport from protocols, and the event loop it uses is
>   extendable and generic. That means:
>
>    - It can run on Jython (using threads, someday with java.nio), and it can
> be integrated with the Tk and GTK event loops.
>
>    - Your protocol doesn't have to worry about the transport - Twisted
> supports SSL, TCP and unix domain sockets right now, without having to make
> any change to the protocols.

SSL support out of the box would be a big deal. It really annoys me that
zope does not support https by default. It is another thing to hunt down
and merge in the config file for and it is necessary for any modern web
server.

>
> 2) Twisted is designed to run multiple servers and protocols at the same
> time, and these can be changed at runtime. It already includes pure python
> support for HTTP, FTP, LDAP, SMTP, POP3, DNS, telnet, AIM TOC, and IRC, all
> integrated with the main event loop (all have server support except DNS and
> LDAP). Adding new protocols to Zope is not easy, at the moment.
>
It would be really nice if it supported NNTP, SOAP, and XML-RPC also.
However the last two could probably be stuck in fairly rapidly since
python already supports those and they run over HTTP already.

> 3) Twisted is being actively developed and extended. medusa less so.
>
Actively developed would definitely be an improvement.

> 4) Good integration with threads - while event based, twisted has a very
> nice model for dealing with threaded apps.
What benefits would this really give? What drawbacks would we have to deal
with? Overall I have noticed that python does not seem to actually thread
very well since there is that global lock.

>
> 5) Twisted has Perspective Broker, an async.ready remote-object protocol
> that supports caching, object migration, and remote messaging, with
> integrated authentication and authorization. And it ideologically meshes
> with the "object publisher" notion in Zope. No, really :)
>
This part sounds pretty cool I will definitely have to look at it some
more. I looked at it a little while ago and it looked very cool however
zope has some serious things that twisted does not. Mainly I really like
how the access control system works, the user folder system and the object
store.

>
> Twisted already includes a high-level web framework, but Zope probably would
> not use it, and instead build its own on top of twisted's low-level http
> support.
>
We could essentially keep the ZMI however I do think the ZMI is due for a
large rewrite soon. The frames and a few other things have got to go.
Mostly because xhtml 1.0 is the last html version to even have frames and
zope will have to adapt as things progress. It would not surprise me if in
2 or 3 years most new browsers didn't support frames anymore.