Scalability != performance. In fact, having to scale your architecture significantly with growth may be a symptom of a poor application performance. Yet, with the rise of cloud and the abundance of automation and container tools that simplify scalability aspect of your system, performance considerations are often pushed to the back row. Building systems for high performance is not easy. It requires a lot of considerations – from technology selection to design decisions. And “the cloud” does not magically solve those problems for you. In this talk I’ll discuss common performance pitfalls across the stack and talk about useful techniques and examples that every application could benefit from.

In preparation for my talk for php[world], I was genuinely concerned that the topic was too basic for vast majority of developers (I even purposely named the talk PHP performance 101).During the talk, I was really surprised to see that most people in the audience found the performance tips I prepared helpful, if not critical, in solving their current problems. I even had one person admit that they were still struggling with n+1 problem. I guess admitting the problem is the first step to recovery. Because of this type of (somewhat unexpected) interest, as I see problems in codebases I come across, I try to write more detailed posts giving people real examples of performance impact. This one is about minimizing connection overhead and number of round trips to the database.Continue reading Optimizing bulk inserts

Every developer blames his or her predecessor. Whenever we get to work on, or maintain, a codebase that was developed by someone else, the first impression is always a negative one. Along with second, third, forth…up to nth. Someone else’s code is always worse than what we would’ve developed, given the opportunity. The design is wrong. The code is messy. There is insufficient documentation. The problem could’ve been solved in a more efficient way. Variable names too short. Variable names too long. Truth of the matter is – even when we look at our own code years later (and sometimes much sooner) we criticize it in exactly the same fashion. But after years of dealing with unrealistic deadlines, last minute changes in requirements, and “visionaries”, who cannot explain what they want, yet want it to work exactly the way they envision it, I’ve learned to make a distinction between “necessary evil” and complete incompetence.Continue reading How to make enemies

Every technologist has a technology preference. PHP vs Perl, MySQL vs PostgreSQL, Chef vs Puppet, Microsoft vs … well, pretty much everyone else. However, good technologists know the advantages and disadvantages of different tools to make the argument pro or against one of them. Others just blame technology for their own lack of knowledge.Continue reading Blame game

At $work we specialize in performance audits on systems of every size, from start-up sites hacked together overnight, to a ginormous applications built by world-recognized brand companies. I’ve seen a lot of interesting (and sometimes very unique) performance issues in every level of the stack: code (front-end and back-end), architecture, databases, (sometimes all of the above), but there is one particular, very “Performance 101”, issue that I see all the time. And frankly – it bugs the hell out of me. In fact, the problem is so common sense that writing about it seems a little embarrassing, yet the frequency of seeing the same issue is proving otherwise.Continue reading One query show

Recently I realized that I don’t hate PHP, as I thought for many years, I just hate people who code in PHP. And before lynch mob starts knocking on my door, let me elaborate.

PHP requires minimal learning curve to get in and whip together a small website (props where it’s due). Unfortunately, the ease-of-use has one major flaw that is a root cause of my frustration. Way too many people, who shouldn’t be allowed to use the computer for any other purpose than to play solitaire, start coding in PHP. Without any previous exposure to programming. Without any knowledge of basic theory. Without a clue. And they like it. And what’s worst of all, they often succeed in their first endeavor. And they crave for more.Continue reading global $issues