Is Python fit for multi-tired apps?

brueckd at tbye.com brueckd at tbye.com
Tue Sep 18 13:56:19 EDT 2001


On Tue, 18 Sep 2001, Eike Kock wrote:

> Is Python fit for multi-tired apps?

Yes, especially as an alternative to Java! The resource requirements for a
good Java-based tier can be staggering, and in my experience Java
middleware scales poorly.

A company I'm working with is doing a large portion of their multi-tiered
app in Python and so far it's going wonderfully well. One thing I really
like is that in Python it's trivial to do custom IPC (i.e. - your own
private protocol) for communicating between different machines, but
there's also modules to support just about every industry standard
mechanism as well.

> Is a pure Python framework a valid option?

Also yes, although how you'd approach this depends heavily on your
specific requirements.  For performance the general consenus is that you
can protoype in Python and then rewrite some components in a lower-level
language if needed, but in many, many cases you'll find that you never
need to do that. For example, your database machine will spend most of its
time in the database itself, so the language you use to access the
database is largely irrelevent, as far as speed goes. As another example,
we made an HTTP proxy server that we assumed we'd later rewrite in C.
After a little performance tuning we're maintaining throughput of several
hundred Mbps, so it doesn't look like we'll need to rewrite it.

Also, if for some reason you can't use 100% Python, that's no
reason to rule out using Python elsewhere. Python is a really nice "glue"
language. For example, in this same company I'm working with they have
some legacy Java servlets that they don't want to abandon yet. One of the
libraries I was working on had a client and server half, both in Python,
and the Java servlets needed to communicate with the server. Rather than
writing a Java version of the client side, I just used Jython to package
up the Python version of the client into a jar file. Now the Java
programmers are using the Python code without even realizing it. Elsewhere
we have Python code calling legacy shell and Perl scripts as well. It's
all stuff that we could easily do in Python but since it's already
written, and it already works, and because it's so easy to call them from
Python anyway, we just went ahead and used them as is.

-Dave





More information about the Python-list mailing list