fromJune 2015
Column:

Caffeinated Drupal

Of Hearts and Flowers
0

 Coffee One of the signs that you’re in a good coffee shop is if they serve their milk-based espresso drinks with an artful rosetta (floral pattern) on top. This is referred to as Latte art. At first glance, it may appear to be an offhand flourish by the barista – similar to a bartender flipping a bottle in the air before pouring a drink – but it is actually much more than that.

Latte art is a representation of the care and expertise that went into creating your drink: a good quality coffee bean; the ideal grind in order to pull an espresso with the right amount of crema (the oily brownish foam that sits on top of a good shot of espresso); milk that has been steamed just right to have a micro-foam consistency (uniform small bubbles throughout); and, of course, the perfect pour to blend the milk and espresso just right until a flower, heart, or other artful creation emerges on top.

While we sit back and enjoy today’s coffee – a Brazil Yellow Bourbon Latte (amazing bitter cocoa flavors, is this a latte or a hot chocolate?!?) – let’s consider how an optimally performing Drupal site compares to the creation of latte art.

There are many factors that contribute to a high performance Drupal site. For starters, we can look at factors such as code quality, the use of caches where possible, database configuration, and front-end caching. For a Drupal site to perform at its best, all of these components must be done well. Even a small misconfiguration or a bit of buggy code can be enough to slow a site to a crawl, especially when serving a large amount of traffic. The same can be said for latte art: if the coffee beans aren’t fresh enough to produce crema, or the milk isn’t foamed properly, or the pour of the milk isn’t done with the correct technique, the result will be an ordinary-looking – and possibly poor-tasting – drink.

The idea that one small misconfiguration in your code or infrastructure could bring a site to its knees is common knowledge to many Drupalistas and veteran system administrators, but it can definitely be a surprise to those unfamiliar with web development. To the uninitiated, it may be difficult to comprehend that something as small as the lack of caching of a frequently called SQL query could make the difference between one-second page loads and ten-second page loads, but indeed one or two such problems could make a drastic difference in performance.

What sets a Drupal expert apart is knowing how to track down such a performance issue and, once located, how to implement a fix. Like a barista just learning to create latte art, the number of factors that could affect the final product may sometimes seem endless. But with practice, and quite a bit of learning along the way, it becomes easier to recognize problems and – maybe more important – knowing what needs to change in order to fix them. A seasoned barista could easily tell when the grind size is off, causing a poor consistency and lack of crema in an espresso shot.

Similarly, a Drupal expert won’t take long to realize that the reason Varnish doesn’t seem to be caching any of a site’s content is because an extra cookie was introduced in the site and wasn’t included in the list of cookies to strip before attempting to cache a page in Varnish. Once found, this looks like a very simple fix to a small problem, but of course it’s someone’s expertise that led them to know where to look in the first place. To those gazing on from the sidelines, this “simple fix” is the difference between a site that can only support hundreds of concurrent visitors and one that can support tens of thousands. That’s like comparing a stale cup of coffee from a fast food restaurant with a cappuccino from your local artisanal coffee roaster; the difference is night and day!

Becoming a Drupal expert doesn’t happen overnight.

You can’t walk up to an espresso machine and expect to pull the perfect espresso without a lot of training and practice; the same applies to all fields, including web development. Only with a lot of practice, exposure to different problems, and a commitment to continue learning and improving, can one become an expert.

And be sure to accompany your learning with a great cup of coffee; it’s brain food, after all.

Image:"Pouring a Heart 1" by antphotos is licensed under CC BY-NC-SA 2.0