Tech

Outperforming MySQL by hand

There is this SQL table, right? This is the part where you knowingly nod and prepare yourself for a long story about how a database is as good as the person designing it. Let's call this table an access log. For the sake of argument, let's also say it's 30GB in size, has a 100 million rows, and only has an auto_increment PK ID field. Your task is, should you choose to accept it, to retrieve the last hour of entries in this log table.
Read more

Thoughts on work/life balance

In many ways I consider that the biggest strain with being a software developer is the intensive intellectual work. It’s draining. In my case, I think about problems, possible solutions. I code, test, fix and deploy changes. It’s stressful, demanding and has the tendency to consume your waking time even outside of work. There is no guaranteed off switch. A man sits at a bar, his friends walk in. He’s thinking about efficiently pushing hundreds of millions of rows of data into a database.
Read more

API Backpressure

It's days like this where I love my job. I'm implementing back pressure for API calls that communicate to an external service. Depending on how overloaded the external service is, my API interface adapts to use caching more extensively, or to use a service friendly request retry strategy, minimizing impact on infrastructure and possibly even resolving problems when they occur. This is done by keeping track of a lot of data - timeouts, error responses, request duration, ratios between failed and successful requests,.
Read more

API development methodology

Let's say you're writing an API service. You need this API to be highly available, distributed, fast... the requirements are several pages long. The problem with API calls is, that one call might not use the same cache objects as another, uses different data sources due to partitioning or other technical reasons. A typical PHP programmer might just create an instance of every cache class, database class and others he might need.
Read more

On PSR-0 standards, namespaces and code (re-)use

When it comes to working on several projects with different people, having a set of standards to dictate code use and code re-use is a good thing to have. PSR-0 is one such accepted standard. It took a while to realize it, as I so often do, that many useful improvements to PHP mean a few steps forward, a few steps back. I'm going to try to list a few patterns which are the cause of some conflict when implementing PSR-0.
Read more