Scala/Lift: Does it require special http routing?

Since Lift is stateful, each subsequent request to a page/site must go back to the same server. Presumably that means that the front-end load balancer needs to keep track of which client is talking to which server.

How does that work out for hosting on places like Heroku/Elastic Beanstalk, where the load balancer is all done automagically for you by the service? I know if you are setting up all your machines yourself you can set the routing to do the correct thing, but how does it work on these PaaS type hosts where all this is meant to be done for you?

EDIT: Google App Engine would have the same limitations, if i am not mistaken?

Answers


Lift is not really intended to be used in a pure stateless mode, its possible, but its not where the framework excels. ELB does indeed have support for sticky sessions, which is the configuration you need to take up in order to use Lift successfully in nearly any environment.

More broadly, this "sticky session" functionality can be achieved with either software of L4 hardware balancing. You might be interested in chapter 15 of Lift in Action which spends a fair amount of time discussing this very subject and the various session serialisation strategies if you really want that.


Heroku will distribute requests between dynos (processes) evenly so I believe you would have to use some form of sessions serialisation for a stateful Lift app. I believe Elastic Beanstalk does have some facilities to support this however (as ELB does).

David Pollock writes about how to use Lift in a stateless way and also talks generally about the design of Lift in this area here.


Need Your Help

How to not call a function statically in php?

php email methods pear

I am using pear to send mail in PHP. I've followed the example that is on here (http://pear.php.net/manual/en/package.mail.mail.send.php). However, I am getting this error message.

PHP: Html send email in html format

php email html-email

I am following a tutorial http://css-tricks.com/sending-nice-html-email-with-php/ to send mail in html format.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.