On 9/30/07, Mark Green <[EMAIL PROTECTED]> wrote:
> My question was really only about the former, a much simpler problem:
> How to keep a tcp connection persistent and re-use it across requests?

By using a pooling connection manager external to Django. Again,
complicating the application layer with too many details of the other
layers in the stack seems -- to me, at least -- like a premature
optimization that costs flexibility in the long run.

> While this overhead may be constant in most (not all!) scenarios
> it's still a waste of resources that doesn't sit well with me.

You say "waste", I say "trade-off" ;)

And that's what web development is, really: a series of trades. The
ability to "hot swap" front-end or back-end nodees by using pooling
and load balancing external to Django is -- again, to me -- worth the
trade of a slight increase in overhead, because it means you can bring
additional nodes into or out of the pool without having to reconfigure
the application layer.

> I do understand (and endorse very much) that django is a shared nothing
> architecture but imho that doesn't imply "zero internal persistence
> across requests".

Keep in mind also that Django deliberately runs a bit closer to the
bare HTTP than some of the heavyweight frameworks and that HTTP -- by
design -- is utterly stateless. Again, it's a trade: inherently
stateless architectures are tremendously easy to scale across virtual
or physical machines, and I'd argue that's worth the use of external
persistence mechanisms when that sort of thing is needed.

> Further problems arise when you need to integrate with a remote peer
> that simply depends on persistent connections. My current candidate is
> the spread toolkit (http://www.spread.org) but it's certainly not the
> only piece of "environmental software" working that way.

There have been a couple people lately arguing about cases where
Django isn't an appropriate solution, and so far I haven't really
agreed with the examples put forth. But in this thread I think you've
hit a genuine use case where Django probably isn't what you want: if
you need high-performance networking with external services, I'd
highly recommend Twisted[1] as the best Python option I'm aware of.

[1] http://twistedmatrix.com/trac/


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to