Search code examples
google-app-enginescalaplayframeworkplayframework-2.0lift

Should I use GAE + Lift for my Scala based webapp?


Such questions have been asked before - but all of the answers are outdated now.

I am looking forward to work on a Scala based webapp. I understand this question can be split into two, but I am posting them as one because they rely on same context, there being a dependency on the hosting platform and frameworks used.

I have read multiple (awesome) debates on Play! and Lift, but cannot find a good comparison between Play! 2.1 and Lift. How do I decide which one is better for my scenario (a social network website) ?

Similarly, this discussion has some very good arguments as to which platform to use for if I go with Lift, but it's from 2010 and seems outdated. The recommended provider (stax.net) is dead (or I guess it's merged with cloudbees.com). I am personally inclined towards GAE, as they are quick to start with, but unsure if the issues still prevail :

  1. Support for actors (I am not sure if Akka helps us solve this problem)
  2. Requests for a given session being served by different JVMs without notice to running app
  3. Quoting David Pollak (lead author of Lift) :

GAE is slow and non-scalable, despite Google's claims (everyone I've spoken with that have tried to scale GAE apps have failed and gone elsewhere). GAE locks you into a tremendously suboptimal storage mechanism. GAE is free, but so is Stax and there are many inexpensive options including SliceHost. Next up, you've got Amazon EC2 and RackSpace. So, I haven't found a good reason for anyone to use GAE. And if there's no good reason to use GAE, devoting a pile of resources to code around the GAE JVM incompatibilities (e.g., no new threads) seems like a waste.

Another issue if I go with GAE is lack of Play! 2.1 support. I still don't see a module for that. Another issue is difficulty to migrate to other databases (although I hear migrating to MongoDB should be relatively easier) in the future. Worst case would be to move out of GAE and use AppScale.


Solution

  • Personally I use Lift, Cloudbees, and MongoLab as my first choice for most of my projects. I tried several cloud hosting services to no avail (Heroku and RedHat in particular. I don't think I tried GAE due to the post from David Pollak that you have already referenced). To use cloudbees, you just need an sbt plugin. Then it is as easy as running the cloudbees-deploy target. Within a minute, your code is up and running. I was floored by how easy it was. I went with Mongo primarily because of this excellent g8 template (note, there is now an SQL equivalent)

    Another thing I really like about Cloudbees and MongoLab is they both have free services. It's great for me because I only work on these projects in my free time, so I don't want to spend any money while my ideas are half-baked.

    As for Lift, I can't compare it much to Play. I downloaded/installed play and was immediately turned off by how MVC it is. I felt that the view-first approach, albeit foreign to me, seemed to be a much more intuitive and powerful way to build web applications. I love how Lift doesn't obscure from me the fact that I am indeed developing a web application. I often feel that MVC frameworks try to keep all of the HTML/CSS/JS etc at an arms-length.