NP@Symfony_Live.2014.NY

symfony_live-2014This October, seven of us from NorthPoint Digital attended the Symfony Live conference in Times Square. The sessions were so varied that each one of us came away from the conference with good advice and inspiration that was unique. We enjoyed reconnecting with the community of developers and seeing the cool things that they were developing and talking about. Having built and expanded numerous Symfony 1.x and 2.x sites since 2008, I’ve been a big Symfony fan…

Now, I am pleased to see that with Symfony 2’s modular framework of components, the “Symfony way” of development continues to appear everywhere. Of course, I’m no historian to give you an accurate timeline of when Symfony 2 was released compared to when great PHP development tools that use Symfony components (i.e. Composer, Assetic, Laravel, Doctrine, etc) came out, but suffice it to say that great web software development practices have been seeping into the PHP development world for some time now. The aforementioned technologies have been crucial in showing the world that PHP should be taken as seriously as .NET, Java, or even the elegant Ruby.

Here is a great example that I can’t go without mentioning – the adoption of Symfony components into Drupal 8. With a developer community as large as Drupal’s, there are bound to be more advances in store for the PHP dev practice.

Over the two days, we heard people speak on topics that went from e-commerce to REST libraries, programming principles to massively scaling APIs, site deployment to performance tools to collecting metrics. The following are overviews of some of the sessions that my colleague, Christine Munson, and I wanted to recap on:

Keynote with Fabien Poncier

The first presentation of the conference was from none other than @fabpot (Fabien Poncier), Symfony’s creator. He started his session by giving tidbits of wisdom with some of his preferred methods for developing web apps using the framework including: 

  • symfony developers need to be more pragmatic: “sometimes it’s best to defactor your code”
  • re: bundles – “most of the time you only need one bundle since bundles are meant to be reused”
  • “don’t create a semantic dependency injection configuration: declare all your services into the main app”
  • “Use annotations to configure routing, caching, and security”

One of the most detailed parts of his talk was when he talked about current development work on Symfony 3. Because the transition from 1.4 to 2.0 involved so many core changes (and the migration path couldn’t really even be called a migration path at all since it involved either rebuilding the app, running two sites side by side, or sometimes both), the Symfony team has been much more careful in planning the version roadmap, including clearly defined end-of-support dates for all major and minor 2.x versions through 2017 (and past 2017 for 2.7).blackfire.io logo

He also mentioned Sensio’s newest nifty product, blackfire.io, a web profiling service for finding bottlenecks in web app performance. I’m not sure how much it differs from New Relic (everyone’s best friend nowadays), but you can sign up to try the Beta version when it’s released here.

Docker with Symfony

In the next presentation, Andre Romke gave a presentation on using Docker with Symfony. Docker is a popular open source project that makes it easier to “build, ship, and run distributed applications.” One common description I often see is, “It’s like Virtual machines but better.” Here’s a graphic I found while trying to elucidate that last statement:

docker-vm-container-620x350

*source

Where ordinary virtual machines (VMs) emulate server hardware, Docker uses “containers,” which share system resources, making them much more efficient. Another benefit besides resource sharing is that Docker was written directly in the shell and doesn’t use any intermediary languages like Ruby or Python, giving it an extra boost. And since I mentioned New Relic earlier, here’s how they use Docker.

docker_logoWell that all sounded pretty cool to me, so that weekend I spent some time investigating Docker a little further. The first thing I found was that Docker only runs on Linux so one needs to use a virtual machine to run Docker on a Mac. Luckily, the intrepid developers behind Docker created a brew script to install a docker VM on mac (brew install docker and boot2docker) and other developers worked out a lot of the fail cases for us.

Give it a shot and let us know how it fits into your dev workflow!

A Decoupled Drupal with Silex

With the increasing popularity of user interface JavaScript libraries such as Angularjs and Reactjs, numerous discussions in the Drupal community recently focused on a “headless” Drupal.  Many like the content management part of Drupal but the slowness of the front-end becomes a liability with large scale applications. While Drupal 8 has adopted some of Symfony’s components, like HttpFoundation and has added RESTful Web Services to to core, it was not yet stable enough to use for a major project last year. In this session, Larry Garfield discussed how Palantir.net used Drupal 7 as their content management and Silex for web services.

Silex, developed by Fabien Potencier and Igor Wiedler, is a PHP micro framework based on Symfony2 and provides a flexible and fast routing system. Testing showed it was 3 times faster at serving a web service request compared to Drupal 7.  Upon saving a node, Drupal pushes its data to Elasticsearch, an “open source search and analytics engine that makes data easy to explore.” Palantir.net used a Silex app as an intermediary to bridge the gap between the Drupal populated Elasticsearch and client requests. Requests would never hit Drupal but would instead only hit the Silex app which would retrieve information from Elasticsearch. It will be interesting to see how a project like this will work directly with Drupal 8’s new core web services and how they stack up to Silex regarding performance.

These were just a few of the sessions from Symfony Live New York. But stay tuned for a post on other interesting sessions that we had a chance to catch at the event.

Leave a Reply