If you break down the iOS numbers between iPad and iPhone/iPod it is about two-to-one in favor of the smartphone.

Overall we are seeing 58% desktop, 30% mobile, 12% tablet. Good to see that Google Analytics is splitting out mobile and tablet now. They are certainly very different creatures and it’s about time the industry recognized this.

A few interesting notes that show that show the bias of our audience versus the internet indexes:

* Our users are early adopters. They tend to be leading indicators of which way things are going. We always saw higher mobile rates than the average. We now see Chrome OS at more than twice the rate of another recent report. We saw Windows and Internet Explorer dropping faster and earlier than other reports.

* Chrome OS seems to be very real. They are flying off of store shelves and starting to gain more mainstream customers. I am happy to say I was an early adopter and saw the value–our family owns two Chromebooks. Anecdotally, my sister-in-law recently replaced her netbook with a Chromebook. They also own an iPad but she chooses to use (and is now a huge lover of) the Chromebook. This is what I mean by it is expanding beyond early adopters and winning some mainstream fans.

* Our visitors love Apple. I’m never sure why this is. Is it a socio-economic thing? Is it a young audience thing? Since we’re more aligned with education audience? I’m not sure but we always see far more Apple users than Android users, even as reports say Android is now more popular than Apple worldwide.

One more interesting note. The stats above are based on VISITS and not PAGE VIEWS. If we go by page views then the balance tips back more to traditional devices. Windows back up over 50% of page views, iOS down to 24.6%, Mac inches up to 16.6%, Android down to 6.9%.

I have been meaning to play with some of these fancy-schmansy new JavaScript frameworks that I’ve been reading so much about over the past couple of years. But with the grind of trying to keep up with all that we juggle on a day-to-day basis, I just kept skipping over the articles. I confess I even looked at them a couple of times and decided they look too complicated for this old dog.

Finally decided to give in to my curiosity, and I’m glad I did. The concept of MVC or MVVM has in the past been reserved for a server side or stand-alone application kind of thing. But with these things that is now changing.

I for one am for beautiful code, and that especially applies to HTML. Despite being largely a PHP developer, I hate seeing HTML templates littered with PHP. Gross!

In my past experiments with doing JavaScript based web apps, I have treated the HTML as “dumb”. The direction I felt HTML5 was taking us was making HTML like a glorified data store. It should simply define the data that goes on the page, with no regard for how it will actually look or function. According to that theory, the CSS makes it look good and the JavaScript makes it do something… but the HTML is just… there. In this scenario the JavaScript (usually powered by jQuery) has to have a rather intimate knowledge of the HTML document. There are structures to make them a bit more independent, but still the JavaScript has to bind to certain events on certain elements and give them purpose.

In a lot of ways that seems unnatural. The JavaScript in this case is serving as the logic, but also has to worry about the display. So the way around this is to flip it on its head. Let’s make the JavaScript just know how to do things and let’s make the view layer know how to display it and understand how the user should interact with it.

AngularJS has a rather elegant way of doing this by using custom HTML attributes and inline text in brackets so that it still looks like HTML but has additonal behavioral logic in it. The CSS still controls the actual display, of course.

Without further explanation, let me just link you to my first test applicaiton and hopefully the code can speak for itself. I know most people are like me and examples speak more than several chapters of a book many times…

Flocasts/MileSplit is a fast growing, dynamic new media company that is redefining the way people engage in the sports they love. Our technology powers and delivers a totally new way to create, consume and deliver awesome content. We tap into the passion for sports and build great communities around that passion, changing the media landscape of that sport forever. We have offices in Austin, Texas and Orlando, Florida. This position ideally would be located out of our Orlando office, but Austin is also a possibility.

What we need:

We are seeking a Mid-Senior Level PHP Developer with 5+ years of experience. We are looking for folks who have extensive experience building scalable dynamic websites from conception to production. While the primary duties will be PHP focused, it is a real perk to have solid front-end experience with modern and semantic HTML 5, CSS 3, and JavaScript (jQuery). Any other backend skills or languages are a bonus such as Node.JS, Ubuntu server administration, optimizing and migrating MySQL databses, Chef deployments, and Amazon Web Services familiarity.

We like people who are easy going and can work well in a highly collaborative team environment and who can shine in that environment given how good they are. We are looking for someone who knows they are going to make a fast impact in the company that they choose. We value people who don’t mind going against the grain, doing something different and want to be part of a company that does the same.

We are looking for people who can make great independent decisions, make forward progress and be accountable for top level development decisions. The ideal person will make a fast impact in a place where you like the people, love the product, push for results and live for the growth.

Day to Day:

Work with the development team to roll out new features, optimize the site to run more efficiently and scale better, and help us to migrate to a new backend platform.

You:

Optimally 5+ years of related experience.

Mastery of PHP 5.

Good background in JavaScript Development background and JS Libraries (jQuery preferred).

Ability to create semantic and concise HTML 5 and CSS 3 pages.

Passion for learning new programming languages and innovative ways of getting things done.

Strong knowledge of OOP, MVC. We are currently working on a Yii framework, but look to migrate to a proprietary system.

Prefer candidate who can work entire stack as needed – UI to SQL to Linux command line.

Experience with using one or more web frameworks is a plus (PHP YiiFramework, Codeignitor, Ruby on Rails, Python Django, Fuel PHP, Zend).

Once again I was frustrated today. Personally I can not stand long, wordy documentation. So while I applaud Amazon for having documentation explaining AWS SDK for Node… just give me a dang example! I would much rather minimal wordiness and just have code samples. The one company who does this right is Stripe and maybe a future post will be about that great payment service–but now I digress.

So even outside of Amazon, I have had a very hard time finding examples with the AWS SDK for Node.JS. So for that reason I’ll try to help fill that void by continuing to post these blogs as I figure out by trial and error.

What is DynamoDB?

I won’t be extensive here, but DynamoDB is essentially a hosted NoSQL solution from Amazon Web Services. It is different from a lot of other NoSQL databases. I actually really like Amazon’s SimpleDB but it seems like they are phasing it out for some stupid reason, so I am getting used to using Dynamo instead.

Why is it good? Because it is really fast, low latency, no worries about storage or scaling, and it is relatively affordable.

Why does it suck? Because there are a lot of limitations on the indexing and querying. And you can’t change your indexes later, so you better get it right the first time!!! I’ll skip the details for a possible futuer post, but long story short…

You must specify a “hash key”, which must be included in every single query (unless you do a full scan). You can have a secondary key called a “range key” optionally. Those two keys together form your primary (unique) key.

Our Application: Logging

I want to move some of our server error/event logging over into Dynamo. You’ll want to log into the AWS DynamoDB Console and create a table. You’ll have to give it a name, keys, and some read/write throughput settings (which I won’t get into). NOTE: You get charged whether you use your table or not, so be sure to delete it after if you’re just testing.

I defined my two keys as follows:

Hash Key: itemName (String)

Range Key: microtime (Number)

The item name is something identifying what the error/event is about. So I might do “video.12345” to say we are logging something about that particular video. And then my range key wil be “microtime” which will be an integer of milliseconds since the epoch. Going to the millisecond there should most likely keep the combination of the two keys unique, even if we log two things pretty close together in the code. You could add something additional to the end if you needed to or try to go to the nanosecond or something. But for our purposes, I think it will work fine.

The other fields (called “attributes” in DynamoDB world) do not need to be configured ahead of time, but I will use:

userID (Number)

level (String) – debug, info, warning, error, fatal

message (String)

details (String)

Note that there is a 64KB limitation that you can store in DynamoDB, but I’m not concerned about that at all for our needs here.

Get Down to the Code

I am assuming at this point that you have set up Node on your server or local machine. You should also have the aws-sdk package installed, if not run this…

npm install aws-sdk

I am not going to go over all this again, but then you need to instantiate and authenticate with your credentials…

A few important things to note here (I learned the hard way on some of these)…

The values of each attribute is not set directly, you set it as a mapped object as above. Use ‘S’ if you are setting a string attribute value or ‘N’ if you are setting a numeric value. There are some other options in the documentation, but I’ll leave it to them to explain those.

If you are setting a numeric value, you may have to still explicitly convert it to a string. I don’t know why but I ran into an error with setting my microtime. I had to add the toString() method to the end of it, even though I’m saving it as a numeric type in DynamoDB. It doesn’t make complete sense to me, but that’s what worked.

Something else I found out, you can not set an attribute value as an empty string. It will fail to insert. So that’s why you see me seeing if the value is set or not. If it is not set then simply leave off that attribute. Again since it’s a NoSQL database those attributes can be changed, added, or left off on the fly. The only ones requierd are your primary keys (hash key and sometimes range key).

That’s all

I haven’t done any fetching of the inserted rows yet, but that should be easy enough. You can look in the AWS Console and scan or query your table to see that they were inserted.

Amazon Simple Queuing Service (SQS) is one of the many great tools on Amazon Web Services. Both the MileSplit and Flocasts platforms all now live 100% on the Amazon cloud, so we are no stranger to them.

SQS is extremely useful when you have jobs that you want to offload and scale. The first thing people usually do is just throw such jobs into PHP on their web server or cron jobs; however, as site traffic grows this becomes increasingly challenging for long-running or frequent tasks. Additionally, it just creates a coding nightmare. What you really want is separation of duties!

The beauty of SQS is also that things do not get lost–independent of any server–and also it eliminates two threads trying to do the same job and bumping heads. Once anything receives the message in the queue, they have an exclusive lease on it for a certain period of time. This makes it especially great once you need to scale to multiple worker servers. Each one just gets the next job in the queue and does its thing, independent of any of the others, and then removes it from the queue once done.

I had some problems finding examples, so I thought I would post it here. I am using the AWS SDK for Node.JS here. I think Node is perfectly suited for tasks like this.

First thing you need to do is install the AWS SDK with this command:

npm install aws-sdk

Here is how you would initialize the AWS SDK and the SQS client. Note the Queue URL is proivded to you in the AWS SQS console once you create the queue.

I commented the hell out of this, so I don’t think it needs much commentary. But here we are using the receiveMessage method to get the first message in the queue. The VisibilityTimeout property is important, this is the length of your lease on this message. Basically you have that long to do something with it. In that time period no other scripts will be able to receive this message so you have an exclusive lease on it essentially. The WaitTimeSeconds is how long it will sit there and see if any messages come into SQS.

sqs.receiveMessage({
QueueUrl: sqsQueueUrl,
MaxNumberOfMessages: 1, // how many messages do we wanna retrieve?
VisibilityTimeout: 60, // seconds - how long we want a lock on this job
WaitTimeSeconds: 3 // seconds - how long should we wait for a message?
}, function(err, data) {
// If there are any messages to get
if (data.Messages) {
// Get the first message (should be the only one since we said to only get one above)
var message = data.Messages[0],
body = JSON.parse(message.Body);
// Now this is where you'd do something with this message
doSomethingCool(body, message); // whatever you wanna do
// Clean up after yourself... delete this message from the queue, so it's not executed again
removeFromQueue(message); // We'll do this in a second
}
});

Once you do something with this job, it is very important that you remove it from the queue. Why? Because if you don’t it will just continue to execute in the queue over and over again. Once the VisibilityTimeout is over it will go right back to the top of the “to do” list and then you got trouble. So if you successfully execute whatever it is you want it to do then delete it! Like so…

We were discussing the other day what PHP Framework had the most traction with developers. This is an important question given that it helps to determine how many potential employee candidates or outsourcing resources you will have if you adopt a certain platform.

You definitely feel it in the community–and the numbers bear it out–that there is kind of an old guard/new guard thing going on. Some of the classic Frameworks are falling out of favor because they’ve become too large or haven’t kept up with the best practices that are becoming standard and commonplace in PHP 5+.

So do you go with an old standard with lots of users or latch yourself to a rising star? I don’t attempt to answer that quetion here! But here is the data…

Popularity by Posts

This should give us a pretty good idea of who out there is using what systems. The freelancer sites (Elance and Odesk) are probably lagging indicator in that a lot of the freelancers for hire will be using the old standard ones. I didn’t find a way to filter StackOverflow by date–I would have liked to do that to only see recent posts–but this should also give us a good indication of what frameworks developers are asking questions about. This is probably closer to a present-looking indicator

Framework

Elance

ODesk

Stack Overflow

Zend

1,820

15,204

32,282

CodeIgniter

1,790

7,009

23,260

CakePHP

1,597

6,048

45,536

Symfony

435

1,349

18,713

Yii

718

2,386

17,711

Laravel

107

145

10,118

Kohana

129

615

6,104

FuelPHP

15

26

703

Prado

27

110

158

Silex

5

31

858

Phalcon

5

4

405

Google Trends

The graph below shows the most popular frameworks that are still either holding strong or gaining steam. Zend also should be mentioned. It has been around the longest and traditionally is the big one. If you add it to the graph it shows it used to dwarft any others, but its interest has been falling like a rock and it has been passed by CodeIgniter and probably will be passed by others soon.

We see newcomer Laravel quickly climbing the charts. It has been soaring and quickly interating on new major versions almost every quarter. And (surprising to me) Yii is also gaining significnt traction recently, perhaps leading up to their much anticipated 2.0 release.

Flocasts/MileSplit is a fast growing, dynamic new media company that is redefining the way people engage in the sports they love. Our technology powers and delivers a totally new way to create, consume and deliver awesome content. We tap into the passion for sports and build great communities around that passion, changing the media landscape of that sport forever. We have offices in Austin, Texas and Orlando, Florida. This position ideally would be located out of our Orlando office, but Austin is also a possibility.

What we need:

We are seeking a Front End Web Developer with mastery in building functional User Interfaces for Web, Mobile and Social platforms. We are looking for folks who have extensive experience building scalable dynamic websites from conception to production.

We like people who are easy going and can work well in a highly collaborative team environment and who can shine in that environment given how good they are. We are looking for someone who knows they are going to make a fast impact in the company that they choose. We value people who don’t mind going against the grain, doing something different and want to be part of a company that does the same.

We are looking for people who can make great independent decisions, make forward progress and be accountable for top level development decisions. The ideal person will make a fast impact in a place where you like the people, love the product, push for results and live for the growth.

Day to Day:

Work with the creative and technical team to build user interfaces that supports the complex relationship and information between users, content and community.