Jonathan H. Wage: Doctrine DBAL: PHP Database Abstraction Layer
Most people think ORM when they hear the name Doctrine, but what most people don’t know, or forget, is that Doctrine is built on top of a very powerful Database Abstraction Layer that has been under development for over a decade. It’s history can be traced back to 1999 in a library named…
12:25 pm • 9 September 2012 • 3 notes | jwage
Jonathan H. Wage: Deploying OpenSky with Fabric
At OpenSky we use Fabric to deploy new versions of software to our servers. We deploy dozens of times a day to our testing environments, and do daily deploys to production.
Our production web nodes are split in to two groups, group1 and group2. It is setup that way so we can easily pull out…
12:24 pm • 9 September 2012 • 1 note | jwage
Kris Wallsmith: Symfony2 ESI error: File name too long
We recently came across a strange, intermittent error at OpenSky:
(36)File name too long: Cannot map GET /_internal… HTTP/1.1 to file
We use Varnish to cache large sections of our pages that include
follow/unfollow buttons. If the user is following a certain curator we show
12:44 pm • 9 May 2012 • 1 note | kriswallsmith
Kris Wallsmith: Hello Spork! (aka "Forking PHP...")
A few months ago I was tasked with speeding up the upload of assets to the OpenSky CDN, which was taking a few minutes each deploy. I ended up dividing the upload into multiple processes using
pcntl_fork() and bringing the total time of the upload down to a matter of seconds.
Since then I’ve…
1:31 pm • 10 April 2012 • 1 note | kriswallsmith
Kris Wallsmith: I ♥ Event Delegation
jQuery event delegation is
one of the coolest things since way cooler than sliced bread.
This new hotness allows you to listen for an event farther up the DOM than where that event is triggered. If you understand event bubbling, you should be able to grok this fairly quickly.
It starts getting…
11:21 am • 24 March 2012 • 5 notes | kriswallsmith
“People tend to say things like ‘Git makes more sense when you understand […]’.”
— Required reading of the day: Think like (a) Git.
11:58 am • 7 November 2011 | bobthecow
Changing history, or How to Git pretty
OpenSky’s engineering and product teams have an ongoing lunchtime presentation series called Lunch and Learn. A couple of weeks ago, I gave a talk entitled “Lunch and learn2git”. I just posted an article on my blog based on that presentation. Check it out!
10:07 pm • 4 November 2011 • 1 note | bobthecow
How we chose Symfony2 as our web framework
As we set out to build the next great social ecommerce platform we were struck with a rare and great opportunity to start with a clean slate. We were able to select each piece of our architecture without any predefined requirements. This let us review the state of the Frameworks in PHP and select the best one for our needs.
First we developed a set of requirements
Brace yourself, it’s a long list.
- DB Obj relationships ie: :has_many
- Good db migration mgmt
- Good master slave config for db
- Intelligent db trans support
- CRUD friendly
- Business logic kept in model not controller
- Controllers have ability to get heavy
- No heavy loading of controllers
- No race conditions for controllers (ie routing)
- Template engine
- Objects accessible in view
- Widget/component support in view layer
- Good header mgmt
- Good mgmt of js and css files
- All js and css be compressed
- Ability to define explict routes or priorities not based on file system
- Smart SEO urls by default
- XSS & CSRF Protection
- Good Form builders
- Form Validations
- No XML => YML or JSON
- enforcement of coding stds
- Convention and configuration
- Ability to design by contract
- Caching: Support for memcache and sessions
- Configs cached not parsed
- Cloud sensitive
- Good role base ACL support (no global, system base)
- Support for webservices
- Easily loadable support for external libs
- Profiler built in or easy to integrate (timers, number of queries, memory used, etc)
- Localization (currency, dates etc)
- CLI model access
- CLI for testing
- Unit testing
- Actions are unit testable
- Good file handling
- Good exception handling – ie log4j
- Support for multiple environments (dev, test, staging, prod)
Then we looked at any framework that someone on the team would be willing to evaluate. We ended up with 7 Frameworks to compare.
We only evaluated PHP specific frameworks as our team is primarily a PHP team and that is where our expertise is.
Notice that Zend Framework, Cake, Code Ignitor or X Framework aren’t on the list. There were a good 10 or so popular frameworks that enough of our developers had used before and knew they didn’t meet our requirements, so we decided not to spend time evaluating them further.
We performed this analysis May 2010. In the past 6 months both Symfony2 and Lithium which are under rapid development would score even better. It’s not my intention to keep this chart up to date as it’s a representation of historical analysis.
At the end of our week of analysis we had a good overview of each Framework though there wasn’t a clear winner. What was apparent was that a “check” wasn’t equal to another check and some frameworks excelled in certain areas where other’s simply did enough to check the box. This made our analysis quite a bit harder.
Additionally there were some other factors that weighted heavily into our decision. Strength of community, Quality of development and Momentum are the three factors that played the biggest role in our decision making, but are not represented in this feature set analysis.
Ultimately we narrowed it down to 3 frameworks. Lithium, Symfony2 and Zoop2. All 3 were PHP 5.2+ and Next Generation Frameworks. Given the substantial changes accompanying PHP 5.3, we determined that either we went with that now, or had a painful migration in our future. We decided to bite the bullet now which left us to choose between Lithium and Symfony2.
Lithium vs Symfony2
This wasn’t an easy decision. Both are excellent frameworks developed by really smart people. Nate Abele, who started the Lithium project and was the lead developer of CakePHP, is’s a personal friend and an NYC local. He was the person who turned me, and consequently OpenSky, on to MongoDB. Nate is doing innovative things with Lithium and has a true passion for what his work.
Symfony2 is developed by Sensio Labs located primarily in France, on the other side of the world. At the time there were only 3 stateside Symfony team members. Symfony2 uses a bit more conservative approach to framework development, basing it largely on learnings from symfony 1 and established practices and patterns largely from the Java world.
Ultimately we went with Symfony2. It wasn’t a cut and dry decision and in spite of all our diligence still ended up as a bit of a gut call. Symfony boasted a larger developer base and community. This was probably the factor that ultimately pushed us in Symfony2′s direction.
Fast forward 9 months. OpenSky has embraced Symfony2 with open arms. We have become the 2nd largest contributors to Symfony2 behind Sensio Labs. We employ Kris Wallsmith and Jon Wage, two core Symfony2 team members. We’ve developed one of the first production applications using Symfony2 and the first ecommerce platform on MongoDB.
More on why you should use Symfony2.
by Steve Francia
11:00 am • 3 February 2011 • 7 notes | osky-tech-admin