Ping Conference, Play Edition, Day 1

Ping Conference, Play Edition, Day 1

PingConf logo

A few days ago I attended Ping Conf, the first ever conference about Play, organized by Peter Hausel (@pk11), and Gawker Media in Budapest.

The conference took place in an amazing venue1 and was all-in-all one of the best events I’ve ever seen2.

The program was organized in a single track, with each talk at around 50 minutes plus 10 minutes of questions. Every two talks there was plenty of time to get coffee and talk to speakers and attendees.

The ticket included high quality food (breakfast + lunch), drinks, and an after-party. What I really liked was the organizers’ attention to detail, for example the badge consisted of two cards, where the second one would contain the schedule.

Attendees

Around 150 people from mostly Europe, but also the US and Australia, came to watch and listen to talks dedicated to our favorite framework. The attendees’ backgrounds were pretty diverse, long-time Play hackers vs. people who were only interested in it, developers vs. project managers, Java vs Scala, and so on3.

I think it’s rare to go to a technical conference and meet so many nice people. It was also interesting to put faces to the names of the guys who are active on Twitter, blogs, and the mailing list.

All in all, it was exciting to talk to people who share the same passion about this little web framework4.

Talks and Speakers

This conference didn’t have a single boring talk, each one offered many take-aways and bits and pieces. They also dealt with many different topics and originated from various backgrounds (as you’ll see later on). They included high-level Scala abstractions as well as practical challenges like how do you migrate PHP developers to Scala.

Another big plus was the fact that the guys behind Play were (nearly) all there. Everytime a question about Play internals or design decisions came up, the experts themselves would answer. I also made quite extensive use of this opportunity ans asked them many questions directly. Thankfully, I got detailed answers and gained a lot of new insights, some of whom I’ll try to share in this and the next blog post.

The Talks

All of the talks can be watched online. In the following, I’ll give a short summary and also add some of the stuff I asked the speakers in person.

Keynote – Stream

Sadek Drobi (@Sadache), co-creator of the Play framework 2.0, talked about how Play came to be, and how functional programming influenced its very core abstractions. He started at explaining that the most powerful feature functions have to offer is composability, and you can see mapping an HTTP request to a response as a function call5, and how to maintain functional properties in various different contexts.

Talk 1 – Expanding Play to a Multiple JVM Architecture – Stream

Note: This was a replacement talk for Scott Clasen from Heroku.

Matt Hamer (@mthology) shared Gawker’s approach to scaling Play apps by running multiple JVMs (instead of just servers). Each JVM runs one part (i.e. module) of their Play application. This way you can load-balance easier by firing up more JVMs if one part of your app is receiving more load than others. It also allows you to isolate components and deploy them individually (so a bugfix only make one service go down for a short while instead of the entire system).

He then went on to explain their service architecture which is currently REST+JSON, but they are experimenting with Akka for messaging between services. For this they are unifying data using Protocol Buffers and a custom serializer (e.g. for data compression).

So far there is no clear winner between the two approaches. In terms of performance, Akka + ProtoBuffs should be faster. It however means that every app needs to consume services via Akka.

Talk 2 – Javascript functionality coming to Play 2.3 – Stream

Christopher Hunt (@huntchr) presented what’s in store for JavaScript development in Play in the near future. As this is what I mostly use Play for, it was one the talks I was looking most forward to. Christopher didn’t fail to deliver – the team in Australia is currently preparing new shiny things for Play frontend development.

The first one is sbt-web, which offers the basic infrastructure, i.e. sbt settings and directory layout for web projects (independent of Play).

The other one is js-engine, an abstraction over JavaScript APIs (adopting the Node API) to execute DOM-less JavaScript from within sbt. This project aims to bring at least the same level of JavaScript tooling as the Node community has with Grunt or Gulp with the end goal to make Play the #1 tool for web development6. Play will also adopt the WebDriver APIs for DOM-based JavaScript testing.

Christopher demoed the sbt-jshint-plugin which uses both sbt-web and js-engine to run JSHint from within Play (or sbt), and fully integrates with Play’s error reporting. The interesting thing about js-engine is that it can run both JVM-based engines (the default is Trireme) as well as natively running Node and thus achieve speed-parity for development (in his demo JSHint ran equally fast in Play and Grunt).

He rounded this off with a short intro to writing sbt plugins7.

Talk 3 – Structure your Play application with the cake pattern (and test it) – Stream, Slides

Yann Simon (@simon_yann), a French guy living in Berlin, showed us how to refactor a "typical" Play app to a more modular architecture and this way introduced us to the Cake pattern. This was a multistep task, and concluded by actually merging traits to reduce some of the complexity and compilation speed issues. All this was presented using funny monster videos and a French-German accent.

Talk 4 – Typesafing your blobs with Scala – Stream, Slides

Julien Tournay (@skaalf) and Pascal Voitot (@mandubian), both employees of Zengularity and active Play contributors, put on quite a show introducing us (again, French accents) to the ideas of entropy8 versus complexity. One take-away was that while entropy ("disorder", or "randomness") keeps increasing, complexity only initially increases and then decreases. This laid the foundation for what they called Entropic Design of web services, which should be polgylot, multichannel, and multiformat, providing a thin adaptive layer that protects the client from malformed data sources.

To achieve this, we must validate the incoming data, and transform it to the format our service is offering. Luckily, Captain FP will help us with this daunting task.

Back to Play, where the JSON and the form API currently solve a similiar problem, but in distinctive ways (complexity). These two APIs will be united in 2.3 to form a new API (more entropy, less complexity) that also allows to add new formats (via the new Rule typeclass). The API is slightly different from the JSON API, and very different from the forms API. You can check out this pull request for more info.

Afterwards there was quite a discussion about some of these concepts. Again, thanks to the authors being there, questions could be answered on a very high technical level.

Talk 5 – Writing a reactive web app with Scala.js and ReactJS – Stream

Matthias Nelsen (@matthiasnehlsen), well known for his blog posts about BirdWatch, showed us his latest findings in rewriting his chat app (to add some juice to the chat demo, he had some actors quote Romeo and Juliet) and BirdWatch using Scala.js and Facebook’s ReactJS.

Scala.js allows to write frontend code in Scala and then compile it to JavaScript. According to Matthias this posed a problem with AngularJS which cannot handle the immutable nature of Scala’s collection. Angular’s dirty watching that runs in every $digest-cycle compares if an object has changed (via a $$hash key) to update the UI. As we all know, when you ‘modify’ a Scala collection, you receive an entirely new collection and Angular tries to update everything, ultimately blowing up its internal stack (the dreaded 10 $digest() iterations reached. aborting exception). ReactJS on the other hand builds on the (functional) concept of immutable streams (Reactive programming principles anyonone?) and only expects a key property to identify objects. This makes it the ideal framework to work with Scala.js. It also offers significantly better performance than Angular, thus being well suited for mobile development.

Talk 6 – Play2 and Redis: when simplicity meets productivity – Stream

Nicolas Martignole (@nmartignole) talked about his startup ZapTravel, built on top of Play, Scala, and Redis. He argued how Redis was offering better tools (in his specific context) to query for travel results depending on the user’s search parameters (for example, you can union different result sets together in the database).

He also talked about how it can be quite a challenge to find Scala developers, so they switched their hiring strategy to find good developers (with any language background) and train them on Scala.

Pre-conference meetup

The evening before the actual conference, the organizers hosted a Scala user group meetup to introduce people (both attendees and non-attendees) to Play.

The goal was to create an app that fetched tweets from Twitter, put them in Redis and stream them to a websocket. The individual tasks were split across several teams9. The app didn’t get finished, but it was nice to already meet some of the other attendees.

Summary

Well, that covers the first 1.5 days of this awesome conference. Day two coming soon!


  1. BMC; when you look it up on Google Maps, all you can see are ruins. The walls of these ruins have been integrated into the new building.

  2. Disclaimer: I don’t go to a lot of conferences, around two per year.

  3. However not many women attended, I think I’ve seen like three.

  4. If you’d like to keep in touch, just add me on Linked In.

  5. Of course this is not a perfect analogy because HTTP requests are not necessarily idempotent.

  6. They are also considering integrating Grunt with Play directly.

  7. So far it looks rather complicated. I hope to blog about it in the future.

  8. Here’s an intro to entropy on Wikipedia, and also see this blog post that they referred to in their talk.

  9. My solution to the Twitter fetching part can be found here

Posted in Scala & Playframwork
One comment on “Ping Conference, Play Edition, Day 1
  1. Stefan says:

    A great summary, thank you! Looking forward for the second day 😉

1 Pings/Trackbacks for "Ping Conference, Play Edition, Day 1"

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Time limit is exhausted. Please reload CAPTCHA.