[elephant-devel] Advice on multiple deploying multiple applications/repositories
Ian Eslick
eslick at media.mit.edu
Fri Feb 6 22:08:20 UTC 2009
The answer to this depends on the web framework you are using.
A simple answer is to dynamically bind *store-controller* for each app
for each request/thread. Since each thread will have its own binding,
each is tied to a particular application.
If you put all your database IO into a with-transaction body you can
use the :store-controller argument to pass in the current store which
will then be bound to *store-controller* in the body of the with-
transaction form.
If you use a higher level web framework like weblocks, it already
directs through its own store abstraction and supports multiple
webapps, each with a different store which will then handle all the
*store-controller* stuff for you if you don't violate the abstraction
(which you will probably want to do, however).
If you are rolling your own web framework, then I'd just implement
abstractions around the database operations which know what app is
running and directly supplies the appropriate store-controller to the
functions requiring/supporting :sc or :store-controller arguments.
However, if each of your apps is that independent, why not just put
one per server and avoid the complexity?
Ian
On Feb 6, 2009, at 4:31 PM, John wrote:
> Since our interest is to use Lisp and Elephant to create web
> applications, I'd like to request some deployment advise for Lisp
> and/or Elephant.
>
> Our intention is to have Apache in front of a Lisp image running
> some web server, where Apache will simply allow us to proxy/load-
> balance traffic. Maybe we could have Lisp running in a large machine
> "fronted" by multiple Apache servers.
>
> Imagine we want to offer to separate services. One would allow
> people to maintain a list of friends and contacts (AKA a contact
> database) and the other will allow people to maintain a To-Do List.
>
> We thought we could have a single Lisp instance listen for requests
> based on URL or entry points. Each application would have its own
> data store. By default, Elephant functions use *store-controller* to
> connect to the data store. However, since we'll have multiple data
> stores, the question is: should we be rebinding *store-controller*
> for each application, pass a specific :sc argument to all our
> function calls, or simply have multiple Lisp instances running and
> listening on different ports for each application?
>
> I thought we could just have a single Lisp instance for all the
> applications we wanted to deploy, but am confused as to how a single
> Elephant instance could handle multiple stores, one for each
> application, or better yet, what would be the most advisable
> deployment model for something like this.
>
> Thanks in advanced,
> JD
> _______________________________________________
> elephant-devel site list
> elephant-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/elephant-devel
More information about the elephant-devel
mailing list