InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

David Pollak on lift and Scala

Posted by Gavin Terrill on Mar 11, 2008

Sections
Development
Topics
Architecture ,
Java ,
Web Frameworks ,
Language
Tags
Scala

David Pollak announced the 0.6 release of lift  yesterday:

lift is an expressive and elegant framework for writing web applications. lift stresses the importance of security, maintainability, scalability and performance, while allowing for high levels of developer productivity.

lift 0.6 brings the following exciting new and enhanced features:

   - Scala 2.7.0 support (which means that you can once again use Eclipse to develop lift apps)
   - Localization of core lift classes (Thanks Marius)
   - Enhancements to Redirect support
   - Cookie support (rather than using underlying Servlet cookie support)
   - Enhancements to Prepared Statements
   - Significant enhancements to JSON support and client-side HTML generation
   - Improved tests and documentation (thanks Eric)

InfoQ took the opportunity to ask David about some of the motivations that lead him to develop lift, as well as his experiences with Scala to date.

Can you give us some background on your experiences that led to developing lift?

I had done 18 months of Rails and 10 years of Java development.  Rails was a fresh perspective on web development... common tasks were the "short path" items.  It was great. However, I found that Ruby's dynamic typing led to a lot of errors and the requirement for 95% test coverage in order to have reasonable deployments.  Unfortunately, to get 95% test coverage, my code size (including tests) ballooned to near Java sizes.  Additionally, because Rails "changes things" (it has different methods that it dynamically changes) between development, test, and deployment, even with excellent test coverage, there were frequent deployment mishaps. The above problems intersected with the MRI Ruby implementation being slow and unstable and a development community that didn't care, I decided to "look elsewhere." I stumbled across Scala and instantly realized it was what I was looking for.  Scala has all the language features that I like in Ruby and all the language features I like in Java.  It was a "you've got your peanut butter in my chocolate" moment for me.

What makes Scala a great environment to build a web framework in?

Syntax.  Performance.  Stability.  An excellent type system that's only there when you need it.  Closures.  Pattern Matching.  Built in XML literals.  Actors.  It's hard to decide.

What would you say differentiates lift from Rails, Seaside or Java frameworks such as Struts or Spring MVC?

As easy and concise as Rails.
As secure and stateful as Seaside and Wicket.
Type-safe yet not hyper-verbose unlike Struts.
Better Comet support than any other web framework.
Support for "real time" application that allow many people to collaborate.
So, you can build wicked powerful apps wicked fast (just like Rails.)  But you don't have the issue of shovelling all your state into a relational database.  The state is "live" not freeze-dried and that makes a huge difference for writing apps that go beyond front ends to database tables.

Can you describe your experiences deploying lift in a production environment? What sort of performance are you seeing?

I've done a fair amount of benchmarking lift applications.  The lift render pipeline is short and sweet and lift runs on standard web containers.  This means that you get similar performance to well written J2EE apps. For non-database pages, lift typically has sub 1ms render time. For pages that require hitting the database, page render times are related to db access. On an Amazon EC2 instance (1.7Ghz Intel processor with 2GB of RAM), I was able to sustain 500+ pages per second and 50% of those pages had DB access and the MySQL instance was running on the same box.

How do you see lift working with existing Java applications, or in mixed language environments (e.g. JRuby)?

lift works very well with existing Java code.  lift's RabbitMQ and XMPP support is based on Java libraries.  Scala calling Java code is 100% seamless.  Scala implementing Java interfaces and subclassing Java classes is 100% seamless.  It just works. There's at least 1 lift project that's lift and Spring co-existing in the same WAR file.  My first Scala app was a Servlet container.  I was so blown away that "it just worked."

No comments

Watch Thread Reply

Educational Content

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.

Beauty Is in the Eye of the Beholder

Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.

Architecting Visa for Massive Scale and Continuous Innovation

John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.

Max Protect: Scalability and Caching at ESPN.com

Sean Comerford unveils ESPN.com’s architecture, what components are used and why, and the current changes the website goes through.

The Seven Deadly Sins of Enterprise Agile Adoption

Are there repeated patterns of failure on Enterprise Agile Enablement efforts? Sanjiv and Arlen discuss Seven Deadly Sins to avoid when adopting Agile in an enterprise.

Questions for an Enterprise Architect

Erik Dörnenburg answers: What is Enterprise and Evolutionary Architecture?, discussing 4 issues: Turning strategy into execution, Ensuring conformance, Where do the architects sit? Buying or building?