Image for post
Image for post
Havana, Cuba © Leon Fayer

Perhaps one of the all time favorite talks I’ve ever given was Production Testing through Monitoring (for those who understand Russian, there is a longer variation of this talk focused on measuring business success). The talk’s central theme is a promotion of business-first monitoring with upwards correlation of supporting technical metrics, but I’ve talked plenty about it over the years and that’s not what prompted today’s rant. …


Image for post
Image for post

Most performance conversations, at one point or another, will get to the subject of caching. And for a good reason. Caching helps to hide some of the biggest performance inefficiency in many systems. That’s right, hide not fix. Whether it’s local storage of data, pre-calculated data set or a transient storage to reduce a number of server-side requests, all these methods are improving performance by limiting the frequency of expensive operations. …


Image for post
Image for post

Unless you are running a complete brochureware site, chance are, you have some sort of content personalization requirement, whether it’s user’s name, number of items in the shopping cart, custom navigation or something entirely different, specific to a particular user.

Let’s examine a prototype of a standard e-commerce personalization logic.

When a user logs in, on success, we store their identifier in a session variable (commonly — browser cookie). When that user navigates to a different page, we retrieve user information (to acquire first name to display) based on the identifier stored in a local cookie and then, if the user exists, we pull user’s shopping cart information to display a number and, in this case, amount of items in the cart. …


Image for post
Image for post
Columbia, Maryland © Leon Fayer

In this day and age, more and more applications leverage external services. So much so, that only about 6% of all sites has no 3rd party content and almost 40% of all site have between 75% and 99% 3rd party content. And for a good reason. External services provide a tremendous benefit, not only in brand familiarity and content, but also in cost saving, considering you’re leveraging years of someone else’s work for your gain.

However, one of the major risks when implementing a third party service is the reliance on the availability of that third party service. Availability of your production site. Based on the service that you have no control over. And no matter how large or successful the service that you’re using is — it will go down (or become unavailable) at one point or another. Perhaps the best example of it is using Google CDN for jQuery, only to realize that your site will break for all Chinese users, since, you know, China blocks all traffic coming from Google. …


Image for post
Image for post

I gave a talk at DevOpsDays Baltimore about biases that influence our daily decisions.

Every day we make decisions. Those decisions can be around improving your product, process, company; sometimes even bettering yourself. But many of our decisions are not made consciously. We all have biases. And even though most of our biases are unconscious, those biases still can get in a way of making the best possible decision. This is not a talk about gender and racial bias in tech hiring. This is a talk about different biases that skew our technical decision process that we deal with in out day-to-day operations.


Image for post
Image for post
Penn Station, New York © Leon Fayer

Every type of content was not created equal. Nor should it be served the same way. At a high level, you can separate your content into 3 groups:

  • infinitely static — image is a perfect example of this. Once an image has been published, you should never update it (because multiple reasons) and should be able to cache it almost indefinitely.
  • temporarily static — this covers the content that renders into static output. CSS, articles, etc. …


Image for post
Image for post
Prague, Czech Republic © Leon Fayer

Loops are generally not great from the performance perspective, but often times it’s relatively easy to pinpoint and optimize those inefficient function you wrote and call inside of a loop. But sometimes, especially with JavaScript, the functions causing the performance hit are the ones that are provided to you by language.

Let’s look at the most basic example of taking an array of items and adding them to your html table.

for (var i = 0; i < items.length; i++) {
document.getElementById("listGrid").innerHTML += "<tr><td>" +
items[i].name +
"</td></tr>";
}

Image for post
Image for post
Toronto, Canada © Leon Fayer

Perhaps the most effective caching mechanism is in-memory cache. Tools like memcached and redis give a great out-of-the-box capability to store and retrieve your content to/from memory and effectively manage TTL. But what can you do when you don’t have those tools available?

Never fear, you can implement your own on-disk cache. While not as effective as in-memory cache, it would still provide a significant relief to system under heavy load.

The basics

The premise is simple. …


Image for post
Image for post

I started my career as a developer in the mid-90s, around the DC area, as companies were just starting to realize the benefits the web could offer. Back then, as you would around that part of country, I started off by doing a lot of government contracts for different agencies. As many companies during that time,back then (and especially given government role segmentation) it was a widely accepted practice that developers could never access production. We sat quietly in the corner, wrote the code, and threw it over the wall to operations to deploy and manage. We were not allowed to not touch the production database or any of production services. Which made the feedback loop … interesting. …

About

Leon Fayer

Technologist. Cynic. Of the opinion that nothing really works until it works for at least a million of users.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store