Menu

Johan Gant

Drupal Team Manager

SymfonyLive 2015 summary

Related post categories Digital products
x min read

Hosted at the Queen Elizabeth II conference centre in London, SymfonyLive is a conference aimed at developers, engineers and other professionals who use the Symfony framework itself or technology related to it.

Symfony is designed to be modular in the form of components and Drupal 8 has been designed to be able to work with these components. As a result, this conference has suddenly become far more relevant for current or prospective Drupal developers.

Keynote

The conference was opened with a keynote from Seb Lee-Delisle. For those unfamiliar with his work, Seb describes himself as a digital artist who uses computers and technology to inspire and develop curiosity in people. He not only gave an amusing introduction to some simple canvas programming in Javascript (turns out everybody loves creating sparkly, moving things in canvas!) but also displayed some amazing projects such as Lunar LanderPixelPyros and, with some audience participation, Clappy Bird: a flappy bird clone where audience clapping volume determines the height of the bird; deceptively difficult to control!

'Symfonic' Architecture

Richard Jones from iKos delivered a summary of how Drupal is moving towards a more ‘Symfonic’ architecture and how that is being received in both the Drupal community and the wider PHP community. While it’s easy to regard the change from Drupal’s particular way of working to a more object oriented approach as a threat, it is clear that the majority of Drupal developers are welcoming the move. It’s great to see Drupal contributing to and adopting standards from the PHP FIG (Framework Interop Group). Interestingly, Richard has been involved in putting together a book on Drupal 8 development - I look forward to reading it when it’s ready.

PSR-7

PSR-7: Beau Simensen delivered a great overview of what PSR-7 is and what to expect from it. For those unfamiliar, PSR stands for PHP Standard Recommendation and is a means for representatives from different PHP projects to put forward proposals on how to implement specific, standard approaches to common problems ranging from coding styles to the autoloading of classes. PSR-7 concerns itself with providing a simple, common approach to handling HTTP requests and responses. It also aims to remove the dreaded ’S word’ from HTTP handling: State. APIs or web services that require state can be hard to test or debug. On the contrary, stateless equivalents are far more predictable and easier to work with. Projects such as Guzzle and Symfony implement PSR-7 and Drupal 8 is not far behind. Stackphp looks like a great piece of middleware for projects that do a lot of HTTP processing, such as an API.

Hexagonal Architecture

Matthias Noback provided an interesting overview of Alistair Cockburn’s Hexagonal Architecture for designing Symfony projects. Large, complex applications typically maintain a separation of concerns between the layers of the application and using interfaces instead of using concrete classes provides the basis of a concept known as dependency injection. Dependency injection is not a new concept to software development, but they will be new to Drupal and they provide a far simpler manner for developers to test the code they write. Traditionally, unit testing of Drupal projects has been problematic as many system components rely on having access to the database, filesystem or other content or configuration, meaning often a full operational application is required to test even the smallest of changes. This makes automated testing slow and often impractical.

Messaging Technology

Phil Leggeter is an expert in real time (or near real time) communication or messaging technology. There are many tools and services around these days meaning you can build your own PubSub infrastructure or use a hosted service such as Pusher. Phil demonstrated how you can use something like Redis’ pubsub feature to provide a means for a chat client to send and receive messages through. During his talk, I set up a Pusher account and took it for a spin - it was that simple to use. As it happens, Torchbox already use Pusher as part of the iShamba project for Kenyan famers. The take-away message was that developers and project owners need to carefully weigh up the time required to build/maintain custom solutions against the subscription costs associated with services such as Pusher.

Closing Keynote

The closing keynote was delivered by Fabian Potencier (the creator of Symfony) showing the roadmap for Symfony 3.0 and an overview of how they merge bugfixes into older, supported versions of Symfony. This is in contrast to Drupal whereby the community expects and plans for major core updates to break APIs and works around them, an aspect that may contribute to Drupal’s occasional reputation problem - especially for those unfamiliar with the way the development community manages with this policy.

Blackfire

Most exciting of all was the ability to speak with the developers behind my favourite tool this year: Blackfire. Blackfire is a fantastic tool that allows developers to profile specific pages and even benchmark them over time. It’s not restricted to a particular framework or product, so it works as well with Drupal 6 as it does with Silex. 

Tools such as New Relic offer something similar, but only on your production server. This is great for measuring overall trends and metrics over time, but if it is telling you that your site is too slow on production - it’s telling you too late! That performance bottleneck could be costing you page impressions, user engagement or even online shopping revenue from abandoned transactions. 

Blackfire solves the headache usually associated with setting up tools like XHProf and KCacheGrind to provide a visualisation of where the bottlenecks in a page might be. It works by installing a probe in the form of a simple Linux package on your host machine or server. There is a Chrome plugin that is then able to read data from that probe and a web interface to present the profile in a way that is easy to analyse. At its best, Blackfire is also able to tell you how much network traffic is taking place and specific SQL queries that are taking place at specific points in the call stack. 

Symfony

Symfony

In the past, getting this insight has required either some educated guesswork in conjunction with data from XHProf and usually the devel module. We expect to be making heavy use of Blackfire and can’t wait to put it to good use on new and existing projects.

Summary

SymfonyLive was a great event to attend and I hope Torchbox will be able to share some insight of our first Drupal 8 projects in the wild next year.