Monday, May 17, 2010

High availability

Every business owner seems to wants high availability for their website, even if it isn't ultimately important for their business, but no business owner wants to spend more money for it than they have to. However, it doesn't come for free, or even cheap. "There's no such thing as a free lunch", as my high school physics teacher used to say, (likely quoting/paraphrasing from The Moon is a Harsh Mistress).

Where I've seen it work, it was founded on redundancy. Single points of failure are poison. At the least, the redundancy must include:

  • Data redundancy: proper backups, replication, etc exist, as well as a clear, well-tested procedure for recovery; if done right, it would take an extraordinary catastrophe to set the business back more than one day worth of important data; if really done right (e.g. geo-redundant backups), even extraordinary catastrophe might be guarded against to some degree.
  • Machine/services redundancy: at a minimum, HA hosts must be placed in fail-over pairs. There are additional advantages to this. For instance, fail-over paired machines are also typically used for load-balancing. Also, if one of the pair goes down, you have live data that can be directly copied to it for recovery, avoiding having to dig out backups or risk losing any important data
  • Support redundancy: A team of Ops support people (e.g. systems administrators) with over-lapping skills and cross-training, and who participate in an on-call rotation. In my experience, 4 is the minimum team size to avoid fast burnout.
Lastly, remember that sometimes shit just happens. The world is full of uncertainty, and we can only do our best to mitigate it.

Tuesday, April 27, 2010

Oh, Base64 MIME, why did you do it wrong?

Base64 MIME encoding, used in email, some URLs, and probably other contexts I'm forgetting, uses a mapping that is unintuitive and inconsistent with hexadecimal.

Hexadecimal places the digits (0-9) at the front of the symbol range used, causing their numeric value to be exactly what one would expect; user-friendly and intuitive. For reasons unclear, the Base64 MIME spec places them near the end, giving them unintuitive values of 52 through 61. This makes it fundamentally not an extension of the approach used in hexadecimal, upon which it is easy to build by simply adding letters. For instance, if we add G the normal hexadecimal range of 0-F we can represent base 17, and by the same principle we can represent any base for which we have at sufficient characters available to represent it. And so, base 64 could have been 0-9A-Za-z+/= rather than A-Za-z0-9+/= as it is.

In case you're wondering why I care about this, some time ago I wrote (in Perl) a numeric base conversion application, and I was able to construct the appropriate base mapping automatically by building up using the same approach embodied by hexadecimal. Base64 MIME, however, effectively scrambles this mapping for apparently no good reason.

I like the encoding approach of Base64 MIME (4 6-bit bytes <==> 3 8-bit bytes), but the choice of mapping was arrived at with little consideration for its precursors or normal human expectations (yes, I realize it was written largely for the benefit of machines).

See Base64 for an explanation of the actual spec.

Tuesday, March 16, 2010

A Stream of Identities

"Semiotic individuation continues all through life, and the experience that many elderly persons have of being, in some strange sense, another person now than they were in their younger days is not wholly unfounded. We must reject the popular idea of identity as being connected to a particular biological entity or body, and learn to see identity rather as a temporary nodal point along a process that each of us is ceaselessly engaged in -- a process of identity formation and change that does not end until death. It is, in other words, not in the heritable endowment of genetic singularity that identity is to be found, but rather in the lifelong attempt to adjust our personal development to our own unique needs and experiences -- often in spite of the genetically caused defects we might have to overcome."
-- Jesper Hoffmeyer from Biosemiotics: An Examination into the Life of Signs and the Signs of Life (2009, Scranton University Press)

I'm not the man I used to be, and I never will be again. This is not to disparage any earlier form of me (though I do like to think this one is the smartest one); each one did more-or-less the best he could with what he knew and had (and each one, including the current one, had his flaws and short-comings). My thoughts, beliefs, and general outlook on life has over the years gone through some radical changes. I'm not the same person I was a mere 5 years ago, let alone the person I was in high school, or grade school.

Evolution, strictly speaking, applies to biological communities, species or genomes (or cell line descendancies). But the principle behind it, namely adaptation, applies more broadly, and its application to our own behaviors, beliefs, and learning is imperative for a holistically healthy life (as mental/psychological, emotional, and physical health are inextricably interwoven and interdependent). The inescapable fate of those who fail to meaningfully adapt is obsolescence.

The "me" you witness today is not, in whole or part, an essential construct, some Platonic whole that piggy-backs through time attached to this particular body, witnessing the events of my life without being affected by them. My soul, if any such thing exists, must evolve as surely as the rest of me does. It is not some fixed point in (or perhaps outside of) time and space, but rather an eddy in the stream of events that make up my life, prone to moving, changing, being temporarily or permanently disrupted, and eventually disappearing altogether or ceasing to be recognizable. It is no more the "true" me than is my body.

Even those familiar entities and places upon which we hang myriad meanings and conceptual contingencies can change in this manner. A few nights ago, I was thinking about my grandmother's house, and the fond memories I had of spending summers there. Her house was sold after her death. I have since learned that at some relatively recent point in the past it was occupied by people who let it fall into disrepair. It may well be that it is now in better hands, but it hit me that night that the place I knew simply doesn't exist anymore. The house, the physical address, is doubtless still there, but the home it signifies is just as doubtless foreign to me now. Most likely it was different even before that episode, shortly after it was sold. While the outside probably still contains some power to evoke nostalgia in me, it is doubtful that the inside ever would again to any substantial degree. The ghosts of meaning significant to me have been exorcised, detached from the house and now tethered only to my memories.

Sometimes adaptation is difficult, even painful. Sometimes it means letting go of people or places that have been dear to us, or accepting them in a new form that may be foreign, difficult to understand, or even objectionable to us. It is no less necessary for its difficulty, and we must afford to others the same latitude to adapt as life demands of us.