New SessionStore backed by HttpSession #32

Closed
wants to merge 2 commits into
from

2 participants

@coopernurse

Hi,

On the noir group we've been discussing Google App Engine deploys which are clustered. We agreed it would be useful to have a ring SessionStore that targeted the HttpSession provided by the servlet container. The storage semantics of the session would consequently be delegated to the container, which may store it in a db, replicate it, etc.

You'll see that I'm not using the ring session-key, as the session binding will already be scoped to the current request.

Implementation is provided + tests. Java serialization is used. I did some basic perf tests, and they seem fine. Sub 1ms serialization times for sessions of 10kb on my MBP.

Discussion of the general feature here:

https://groups.google.com/forum/#!topic/clj-noir/jM4SJb8NsDU

thank you,

-- James

@weavejester
Collaborator

Hi, sorry for the delay in responding. This past week has been really busy!

I'm in two minds whether to include this into Ring, or to suggest first releasing it as a separate library. It seems a very useful session store for hosts like GAE and any existing load-balanced Java infrastructure, which is likely to cover a not-insignificant proportion of Ring-based applications.

On the other hand, I'd like to limit new functionality added to Ring before version 1.0. Another problem with this middleware is that it's placed in ring-core, but requires that Ring be run inside a Java servlet engine. Perhaps a better place would be ring-servlet, but it would also do well as a stand-alone library.

I think I'm going to err on the side of caution and suggest that this is first released as a third-party library, with an eye to consider incorporating it into Ring 1.1.0 if it proves to be a popular piece of middleware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment