[Zope-dev] Re: [medusa] Twisted, medusa, ZServer, and VFS's

kapil thangavelu k_vertigo@yahoo.com
Tue, 9 Oct 2001 18:42:32 -0700


On Tuesday 09 October 2001 10:48 pm, Donovan Baarda wrote:
> G'day,
>
> First my impressions of the three contenders; Twisted, Medusa, ZServer.
> Please correct me if I'm wrong in the following summaries;
>
> Medusa seems to be the daddy of them all. It's the oldest, which has
> benefits and problems. It is a little messy from its evolution, but seems
> pretty mature. It uses an async select loop to drive everything. It uses
> "asynchat" derived class objects to communicate on sockets. Data can be
> sent by
> pushing "producers" onto asynchat objects. Producers can be complex objects
> that produce data, execute callbacks, whatever. It's ftp and http server
> classes use a primative VFS to serve from. The asyncore and asynchat
> modules it is built on are now part of Python.
>
> Twisted seems to be a from-the-ground up re-invention of Medusa. It's
> newer, but surprisingly it's bigger, dispite it's apparently less mature
> feature set. It is similar in structure to Medusa, but simplifys it by
> dispensing with producers. It can use a variety of event-loops, including
> Tk and GTK, or it's own. It doesen't have a VFS (yet) so its ftp and http
> servers serve from the underlying os filesystem.

twisted has lots of interesting ideas and architecture, but since i haven't 
used it i'll refrain from comment.

> ZServer grew out of Medusa. It uses the same basic underlying architecture,
> but throws in threads to get around the problem of delayed producers
> blocking the event loop. I'm not sure how tightly tied to Zope it is, but
> its http and ftp servers generally serve from a ZODB database, presumably
> wrapped in a Medusa VFS, though I have a feeling they might have changed
> that. ZServer also supports webDAV serving. It is possible that some of the
> enhancements could be merged back into Medusa, but probably it has changed
> so much it would be difficult.

zserver swallows medusa whole, and leaves it pretty much untouched. it builds 
its functionality ontop of medusa. there is no vfs in zope's interaction with 
medusa. requests are handled by an installed handler and are passed off to a 
thread pool which calls zpublisher (zope's orb) that maps requests directly 
onto the zodb. 

zserver's thread architecure is pretty much separate from medusa. a single 
medusa thread handles most of the network i/o. the thread architecture of 
zope (imo) is indeed mainly for avoiding blocking the event loop and  to 
allow zope and separate processing from i/o. 

i never used webdav so i can't comment, but my understanding is that changes 
to medusa made for zserver are basically things specific to zope, using 
zserver is basically using medusa. but using it without zope means you loose 
all the zope based functionality which includes the webdav implementation.

<snip vfs/ftp>

> I'm sort of fishing for general suggestions, comments, and interest. I'm at
> the point where I've just convinced myself my vfs is worth finishing, and
> my ready () patch to asynchat is worth updating, but I'm not sure what to
> use as the http and ftp server front-end, though I'm still leaning towards
> medusa. It looks like Twister is not ready, and ZServer would be too hard
> to seperate from Zope.

my two cents, i'm not sure why you think twister isn't ready but its probably 
worth experimenting with. as for zserver i don't think there is any 
additional standalone functionality that is offered on top of medusa 
distribution that really makes this make sense (with the possible exception 
that you want to use a threaded async i/o architecture like zservers, in 
which case you might also want to take a look at webware's asyncthreaded 
server.)

cheers

kapil thangavelu