> **Full Stack Engineer** · March 2014 to February 2016
> Source: https://www.simonbetton.com/case-studies/buzzdial.md (markdown only; there is no HTML page for this document).
> Index of case studies: https://www.simonbetton.com/case-studies/index.md

# Case study: Buzzdial

## Quick facts

|  |  |
| --- | --- |
| **Role** | Full Stack Engineer, one of two engineers |
| **Company** | Buzzdial, Auckland (founded 2013 by people from TVNZ's digital team) |
| **Product** | A second-screen "dial" for live television: viewers tap up or down, a crowd needle moves about once a second |
| **Timeline** | Employed March 2014 to February 2016. Before that, the original 2013 version for TVNZ's New Zealand's Got Talent at Digital Arts Network, then Buzzdial's first stage before my employment began |
| **My surfaces** | The dial widget and its CSS and asset pipeline, partner embeds, the Facebook Flash client and its campaign forks, white-label skins, creator analytics, and the producer and TV overlay tools |
| **Shared platform** | The JSON API, in-memory vote aggregation and per-second summaries, AWS hosting and auto scaling, in-house load testing. Designed and built by the two of us together; there is no meaningful individual split |
| **Named uses** | NZ Herald "Rate the Debate" (2014 New Zealand leaders' debates), ITV's 2015 UK leaders' debate, and campaigns for Seven, Ten, and SBS in Australia and the All Blacks |

## Overview

Buzzdial was a start-up that put a reaction meter on the phone of someone watching live television. Anyone could create a dial for a show, a debate, or a match and share it by link, social post, or embed. Viewers tapped positive or negative, with labels the creator chose ("agree" / "disagree", "love it" / "hate it"), and their taps aggregated into two live series: sentiment (which way the room leaned) and activity (how many people were pulling). Broadcasters took the same meter into partner pages, Facebook, producer dashboards, and on-air graphics.

My involvement started before the company did. In 2013, at Digital Arts Network, I worked on the original version of the dial, built for TVNZ's New Zealand's Got Talent; one of my managers there was among the founders who took the idea into Buzzdial with others from TVNZ. Soon after that show aired I was working on the new version for Buzzdial, before my employment began. I was then one of two engineers from March 2014 to February 2016. My work was frontend-led: the dial widget, embeds, the Flash client, skins, creator analytics, and the producer and TV tools. The API, aggregation, and hosting were work the two of us designed and built together. The problem I kept coming back to was not raw scale, which the platform side and AWS auto scaling handled, but delivery: the same meter had to render in a 320-pixel iframe, a Facebook video slot that only accepted Flash, a display ad, a partner's white-labelled page, and a broadcast overlay, without turning into five products that a two-person team could not keep in step.

## The problem

People already used a second screen while watching TV. Broadcasters wanted that attention as a signal they could show, sell, and study afterwards. The existing tools were awkward: studio "worms" needed recruited panels and hardware, phone voting was slow and binary, and social posts were noisy, needed moderation, and were hard to turn into one graphic at one-second resolution.

Buzzdial's bet was two buttons and a needle. If tapping felt instant on a phone in a dark living room, the rest of the business could exist. That bet set the engineering constraints:

Live TV traffic arrives in a shape ordinary web traffic does not. Quiet, a presenter cue, a spike, a drop at the ad break, another spike, then the credits. The audience arrives within minutes of someone saying "go to the dial", and the needle has to keep moving about once a second or it looks dead.

Sentiment and activity are different questions. A needle sitting at zero can mean indifference or a tug of war. A producer who could see only one series would misread a divided room as a bored one, so the product had to publish both.

The meter had to look right everywhere a broadcaster wanted it, including builds with no Buzzdial branding at all, and viewers had to be able to tap without creating an account. A signup wall in front of a debate would have lost the room.

Two people had to build and run all of that. Between broadcasts the platform had to cost almost nothing; on show night it had to take a spike neither of us could babysit by hand.

## The delivery model: one meter, many surfaces

The consumer object was a gauge with two buttons, a crowd needle, and an optional "you" needle. Creators set labels, colours, logo, cover art, and share thumbnails. The same component shipped at three sizes so it could sit in a card, a page, or a partner slot.

I built that widget as a self-contained module rather than as part of a single-page application. Show pages needed to be shareable and indexable, so the server rendered them with Twig and the dial mounted into the page. The module was wrapped so it could load under RequireJS during development and be concatenated for production. The alternative, a full client-side app, would have been more JavaScript than two people could test across the phones and tablets in a typical lounge.

Every other surface was a client of the same meter feed:

```
                      ┌────────────────────────────┐
                      │  JSON API (meter view /    │
                      │  batched up-down changes)  │
                      └─────────────┬──────────────┘
        ┌──────────────┬────────────┼────────────┬──────────────┐
        ▼              ▼            ▼            ▼              ▼
  buzzdial.com    partner iframe  Facebook     producer      character
  show page       and display ad  Flash player dashboard     generator
  (Twig + widget) (widget +       (AS3 client) (Xray)        (XML / JSON
                   postMessage)                              meter feed)
```

Partners dropped in an iframe pointing at an embed URL, including units built for display advertising. A small external script used postMessage to tell each iframe whether it was in the viewport, so off-screen dials paused their polling. That was the difference between a publisher homepage full of embed units and a publisher homepage hammering the meter endpoint. Internet Explorer still needed a P3P compact policy on the embed so the third-party device cookie survived the iframe, and Flash needed a permissive cross-domain policy because Facebook and the CDN were different origins.

Skins shipped as data and asset packs, not as code branches. Campaign art for Eurovision, Shark Tank, House Rules, I'm A Celebrity, and the All Blacks lived on S3 and was swapped per show rather than rebuilt into the core CSS. Class names followed BEM so a partner's colours, logo, and chrome could be layered without touching the widget's behaviour. ITV wanted Buzzdial chrome gone and a "powered by" line; SBS wanted transparent thumbs and its own Eurovision art; Shark Tank needed grouped feeds for its character generator. Those were configuration and asset changes on one meter.

Static assets went to S3 behind three CloudFront hostnames. Three was deliberate: HTTP/1.1 browsers cap connections per host and a dial page pulled CSS, JavaScript, sprites, and images at once. HTML and JavaScript filenames were revision-hashed by the Grunt build so a release invalidated the CDN without flushing campaign art, which carried long cache lifetimes. The pipeline was ordinary for 2015. It was also the difference between a designer's tweak reaching CloudFront under a new hash and someone copying a CSS file onto a live box at 6:55pm.

## Decisions and the trade-offs we accepted

Structured taps rather than inferred sentiment. A tap is a labelled +1 or -1. That removes the NLP engine, the free-text moderation queue, and the classification delay, and it keeps resolution at the second because the tap itself is the measurement. The cost is expressive range: nobody could say why they felt something. For live TV that was the right trade; for a comments product it would have been the wrong one. This was the founders' product decision; engineering's job was to make it feel instant.

Polling at one hertz rather than WebSockets. In 2014 we had to support Internet Explorer, Facebook's Flash video player, third-party iframes, and CloudFront in front of static assets. A short JSON poll with a cache-busting segment was something every one of those clients could do the same way; WebSockets meant a different operations story per surface, which two people could not run. Local taps batched into the next write so a furious thumb did not fire a request per tap. The candid part: the write path was a GET so that Flash and CDN behaviour stayed simple. It was not REST, and cache correctness became our problem rather than the protocol's. We lived with that.

Touch first, then mouse. The widget detected touch, made the two buttons large hit targets, and locked the viewport against pinch-zoom on the live experience. That improved tap accuracy during a show and hurt anyone who needed to zoom. I would not take that trade now without confining it to the live widget and leaving a normal layout everywhere else. Accessibility overall was modest: dialog roles on cards, form roles, focus trapping where needed, noscript and old-IE banners. It was not a WCAG programme and would not pass a modern review.

Anonymous voting. A durable device cookie plus a session hash identified a voter; Facebook login existed for profiles and sharing but the live path never required it. Abuse handling followed from that: invalid hashes and over-limit traffic got a limited or faux meter view rather than an error, caps applied per call and per hour with a minimum interval between buzzes, and blocked IPs and sessions sat in cache for two hours. Every buzz was logged with dial, IP, session, country, and command for later quality review.

Flash for Facebook, as a tax. Facebook's Open Graph video format wanted a SWF if the dial was going to play in the feed, so I maintained an ActionScript 3 client that polled the same meter endpoint and posted the same batched changes as the web widget. Campaign builds of that client were real forks (ITV, Eurovision, Shark Tank) because the player could not take the web CSS. The forks were ugly and they were how those campaigns went to air on time. When the format died, the web widget was already the source of truth, which is the only reason the tax was affordable.

Hot counts in memory, summaries on disk. Vote increments went to in-memory caches on the API workers (phpFastCache, with Memcached and Redis in the production mix) so nothing row-locked the live meter. A small daemon on a Unix socket took aggregated ticks and wrote per-second rows to a summary database that analytics read from, so reports never competed with the vote path. The live needle was a sliding window (five seconds by default): a capped ratio at low volume, (up minus down) over total at high volume. The halfway house we accepted was generating Propel model classes and then writing raw SQL beside them: fast to ship, expensive to change. We designed and built this path together; in a team of two the individual split is not meaningful, and I do not claim one.

## Producer and on-air surfaces

Xray, the producer dashboard I built in 2015, showed the live needle, the up/down split, charts of engagement and sentiment, top moments, and a JSON export, with a local-storage cache so a gallery machine survived a network blip. Grouping was configurable down to the second and Apple web-app tags let it sit on an iPad home screen in a control room. The two charts existed to make the split visible: a flat needle with a spike in activity means the room is divided, not bored.

Xray for TV stripped that to time, needle, and a proportion bar: nothing a camera would catch that a director had not asked for. Meter XML and grouped JSON feeds existed specifically for character generators, and start, pause, freeze, and stop were first-class controls because a graphic that keeps twitching during a pre-recorded package is a director's problem. A queue could also render a video overlay after the show from a dial, a start time, and a duration.

For ITV's debate the meter was not shown in the live broadcast. ITV streamed the worm online through YouTube, rendered with Vizrt graphics, and its own page told viewers it ran about 40 seconds behind the television feed. Shark Tank and House Rules did take the meter on air, rendered from the character-generator feeds. The All Blacks campaign ran online; I do not remember whether it also went to air.

## How the platform ran

The first stage of the service and its AWS architecture were built in four weeks as a single web application, and over the following 18 months the application was split into API, web delivery, caching, and database layers so releases could be regular. I had worked on that first stage before joining, after building the original New Zealand's Got Talent version at Digital Arts Network, so the four weeks and the later split into layers are both periods I worked in. AWS was chosen in the establishment phase with AWS solution architects in New Zealand; I was part of establishing the stack, and the frontend build and delivery chain and the API-first shape of the clients are the parts most clearly mine.

Production ran in AWS US East: EC2 behind load balancers, RDS MySQL, S3 and CloudFront, and auto scaling groups across zones, with a small scheduling app that set desired capacity and instance class ahead of known broadcasts. Environments ran from local and branch hosts through test, UAT, prelive, and live, with a separate EU-West admin path added later. Code moved through Subversion on Beanstalk. Load testing was in-house: a controller UI launched worker EC2 instances that each threaded thousands of fake users through the homepage assets and the one-hertz view/change loop, with cookie jars and clock skew checked against the meter. A generic load-test service would not have known about our session skew, device cookies, or the view/change pair. The auto-scaling design and the load-test tooling were work the two of us did together.

## Technologies and standards

| Layer | Choices |
| --- | --- |
| Website | PHP (Slim 2, Twig 1), Sass via Compass with Bourbon and Susy, BEM class names, Grunt build with revision hashing, Bower |
| Dial widget | UMD/AMD module, jQuery, GSAP TweenLite for the needle (matching the GreenSock motion already in the Flash client) |
| Social | ActionScript 3 Open Graph video client compiled in Flash CS6, Adobe cross-domain policy |
| API | HTTPS JSON, XML meter feeds for character generators, permissive CORS |
| Aggregation | In-memory increments (phpFastCache, Memcached, Redis), Unix-socket summary daemon, RDS MySQL per-second summaries, Propel |
| Hosting | AWS US East (EC2, ELB, S3, CloudFront across three origins, auto scaling), Subversion on Beanstalk, in-house load-test fleet |
| Integrations | Open Graph and Twitter cards, Facebook Login, Google Analytics, Google Charts for creator analytics, P3P for IE iframe cookies |

Tests were PHPUnit 4.x, with Selenium in the API test extras. Environments were host-based, not container-based.

## Results

Figures from Buzzdial's AWS case study and from ITV, informitv and the NZ Herald at the time.

| Claim | Figure |
| --- | --- |
| ITV leaders' debate, 2 April 2015 | More than 50,000 participants; over 32 million data points |
| NZ Herald "Rate the Debate", three Key v Cunliffe debates (Aug to Sep 2014) | About 2.5% of the viewing public took part |
| Panel versus open crowd | A 100-person research panel and about 15,000 open viewers tracked closely on a New Zealand debate |
| Early user research | 72% said they enjoyed the show more; 77% wanted dials on other shows |
| Availability during live events | Above 99.99% |
| Response latency | Under 400 ms globally, served from US East |
| Scale-up | Capacity for hundreds of thousands of concurrent users in about ten minutes when scheduled; tens of thousands in 10 to 15 minutes unscheduled |
| Peak footprint | Equivalent of about 60 physical servers, plus about 30 more under stress tests |
| Cost versus collocation | About 96% lower over two to three years; roughly US$1.2 million capital, US$24,000 a month, and six administrators avoided; about 20% of one full-time role for day-to-day ops |
| First stage | Four weeks, before my employment began |

From my own side of the work: one widget codebase served the website, partner iframes and ad units, a Flash client, white-labelled partner pages, and producer and TV overlays for two years without forking into separate products. Campaign changes for ITV, SBS, Seven, Ten, and the All Blacks shipped as skins, asset packs, and feed configuration on the web side, and as forks only in the Flash client. The NZ Herald published issue-level analysis from the dial (which topics moved the room, not only who won), and ITV used it across a seven-leader debate a year later.

## What I would do differently

I would not start a live product in Flash now; in 2015 it was the only way into Facebook's video slot. I would keep the viewport lock, if at all, to the live widget alone. I would document the meter feed as a contract from the start, because partners consumed it before we wrote it down. Creator-side card editing (story, snap poll, share, countdown, and off-air layers on the live meter) was messier than the playback path, and we knew it at the time: a two-person team shipped playback quality first and creator UX ran behind. The broadcast constraints would not change: about a second of latency, freeze during a package, a skin per channel, an anonymous tap, and a bill that drops when the credits roll.
