[plt-scheme] Continuations

From: Akhilesh Mritunjai (mritun.lists at gmail.com)
Date: Fri Nov 17 20:36:35 EST 2006

Hi Noel

Very informative read :) I have been curious about large scale usage
of Scheme servlets and continuations and scalability. It's a pleasure
to see you working on it.

On 18/11/06, Noel Welsh <noelwelsh at yahoo.com> wrote:
>  - Most of our sites are stateless, so don't use
> continuations for these parts.  We dispatch on URL.
>  - Of the remaining stateful parts, it makes sense to store
> a good deal of it in cookies (e.g. login -- should be
> shared by all open browser windows).  We have a request
> handling pipeline that takes care of this.

Well, but as far as I see, the real strength of continuations based
frameworks lie in not actually being concerned about lower level
details. The application developer should be free to be as oblivious
to these kind of details and shouldn't have to work around the
artificial limitations. So I think the framework failed at point when
you had to implement the "pipeline". Though I should say that the
strength of framework is not represented by these kind of systems.

>  - We use continuations for the remaining (few) stateful
> interactions.  If we were to use two or more servers this
> is  the part we'd have to be careful load balancing.  The
> way to do it is to add something to the URL that identifies
> the particular machine that holds the continuation and have
> the load balancer dispatch on the key.  This can be done
> with existing technology.

If we can have a proper serialization mechanism for continuations and
a framework that deals with other issues surrounding it, wouldn't all
this become seamless ? The load-balacers then can issue query to any
of the backend servers which can then just fetch the continuation from
wheresoever it is residing and serve the request ? With a persistence
mechanism, any server can go offline any time, and no state data would
be lost. It may sound too ambitious, but I'd say this would be as
close as it gets to achieve high availability on low cost.

Furthermore, it also decreases substantially the time, cost and
complexity associated with developing rich applications for web and

> In this design there is some vulnerability.  If a server
> dies we'll lose all the continuation calls that it handles.
>  It probably won't be a big issue (continuation calls are
> maybe 10% of all interactions) but it's there.

If a developer has to reduce the continuation calls to work around
these issues, what does he gain ? It is with this aspect that I am
interested in possibility of implementing Scheme-runtime support for
serializable contiuations, persistence and resource management.

> Persistence is the other point you raise.  We've working on
> a library for this (using relational DB backends).  SVN
> access is public:
>  http://svn.untyped.com/snooze/branches/dbms/

Wow..  I didn't know that an effort was already in this direction !!!
I'd surely take a look at this.

- Akhilesh

Posted on the users mailing list.