Code

Watch your JSON

I spent some time this weekend improving the performance of the server-side request processing logic for Imprint. This particular code path executes on every request for an Imprint impression, which on a casual day is around 10k requests / sec. The logic is fairly straight forward but several steps are required before we can send a single byte back to the client. A non-exhaustive list of computations required:…

Read more

A simple caching strategy

We frequently read stories about growing % in six months and somewhere along the way they hit a scalability wall. Requests dropped, users suffered. Many prayers and goat sacrifices later, the problem…

Read more

The Network is Reliable

Those who design systems with the assumption that the network is reliable, have never experienced the joy of an IRC netsplit as kids

Updating Table Schema in Google BigQuery

In every analytics system design, no matter how much you plan what events you gather and what properties to store for each event, there are bound to be omissions. Or sometimes code improvements present themselves that allow for better semantic normalization of the same raw data. Google BigQuery does not allow us to change field names or types and rightly so; in an analytics backend data is assumed to be immutable. We can however append new fields or make some required fields optional. I’m including some code that goes hand in hand with the infer schema snippet I posted a while back. Note that I’ve removed error checks and retry logic for brevity. Unfortunatley Google APIs 500 fairly often so I strongly recommend you code defensively.…

Read more