Blog
Back in 2010, while GROU.PS was a free service pushing 1PB data with 8 million monthly unique visitors, we were bleeding $100K/month on server related costs. The platform was running on ~ 70 beefy servers on SoftLayer and we were using certain AWS products such as S3 and Cloudfront. It was a pretty painful time for a startup that had only raised $2mm with no monetization plans in the horizon. But it was also a big lesson to squeeze every dollar you can out of your CPUs, especially if you’re offering a B2C product that’s free to use.
That’s why I think Facebook’s recent announcement of hack lang (and hhvm itself) are big wins for the consumer internet startup community. PHP is great for getting started, but it is not the most CPU friendly language and runtime out there. And at some point, you’ll need to think about those too.
Fast-forward today, GROU.PS itself is a subscription based business which can finance itself but right ahead of a new (free) consumer product we’ll launch, we wanted to code the frontend in the hack lang, in an obsessive attempt to make the product as scalable as possible at the lowest cost.
So without further ado, here comes the hack-mvc. The MVC framework that we’ll use for the frontend of our upcoming app, and hopefully others will follow and benefit from it.
hack-mvc is far from being a complete MVC framework but it’ll do the work for us, and it’s been very instructional. hack-mvc is a fork of pip so I should also give a huge credit to Craig Russell for his work.
My original goal was to write a fully strict hack framework with dynamodb support in the Model layer and a rich View with mustache.php but it didn’t take long for me to discover the following limitations that rendered the job impossible.
These limitations made it impossible to write a fully hack-strict MVC framework. That’s why while most of the framework is written hack-strict, there are parts that are hack-partial but I’m proud to say at least there’s no use of decl.
tags: