Luke 的个人资料lzcd照片日志列表更多 工具 帮助

日志


    2月28日

    HR Violations in the name of Stored Procedures

    Preface: As my home site of lzcd.com is going to be used for other (possibly evil) purposes, I thought I might christen my new choice of blogging locations with a random thought. Apologies in advance to any DBAs that know me... in particular those who know where I live :)

    It amused me when MySQL (relatively) recently introduced stored procedures.

    Being one of those poor saps that was "raised" in a commercial world of DB use, I had my expectations set at an early age and found the concept of a DB "surviving" for so long without stored procedures almost unimaginable.

    One or more DBAs would patrol the entrance to the DB. Resembling some sort of wizard from the likes of Discworld or Harry Potter, they strutted around in their tattered multicoloured robes, unkempt beards and wrinkled brows. It was only the inexperienced or dim witted that risked attempting entry without the permission of such fearsome guardians.
    (The only ones feared more were the network & sys admin ogres that nestled scarily in the shadows of the basement and whose maddened growls of "netstat" and "traceroute" could be heard echoing down the halls on dark and stormy nights)

    Asking permission to see what lay behind the connection string was a double edged sword.

    If the DBA sensed fear above and beyond the normal levels of terror, as you lay prone upon the ground before him, he would refuse your request with a harsh quip that, if you were lucky, would only strip your self-esteem... and any gains made through that speech therapy you endured as a kid.

    "Be gone from my sight oh lowest of the low," he would exhale dismissively "and I shall let you live with execute access to these fine stored procedures that I have crafted from the very elements of the universe and the stars within that mere lowly mortals such as yourself could never understand."

    If, on the other hand, the DBA was feeling playful and you looked like you had a little too much spirit in the light of the flickering green fluorescents, he would grant you access to selected portions of the database in much the same way killer whales taunt and tease their prey in the moments before the kill.

    Yes, you had access to the database... but it was merely the setup for a cruel ruse. What you thought was a simple construction of a CRUD style stored procedure was in fact a noose of arcane syntax and perverted distortions to set theory slowly tightening around your neck.

    Experienced co-workers would look upon your feverish gaze of SQL coding in a worried pitying stare for it was only after you had constructed what you perceived as a minor miracle of well indexed Cartesian beauty (whose elegance was surely going to elicit religious ceremony from those who observed it) that the DBA would tear it all away from you in one brisk belittling put down.

    The exact words are lost on you almost immediately as the DBA proceeds to enumerate the many faults that infest your creation to its core. Your entire body goes numb. Your brain, unable to focus on the immediate loss, reminisces in a emotional stupor that tattered remains of the life that you used to know.

    The respect that other devs had given you. The small smirk of playful possibility the attractive guy / girl in marketing gave you a few hours before. The honest belief that your could in some small way live up to your parents expectations of being a respected professional.

    All gone. Lost forever.

    This was not a world of peers and mutual respect. This was a world of restricted privilege and inherited birth rights.

    Table schemas were never touched directly and rarely seen in person.

    Indexes were akin to magic incantations that only passed the lips of people whose grizzled collection of scars and matted hair could withstand the consequences.

    The hallowed gateway to all of this was enshrined in the sharp metallic structure of stored procedures.

    They dictated performance. They dictated protocol. They dictated the exact manner in which all applications would need to bow towards the all seeing and all knowing gods of data: The DBAs.

    Living in this reality for so long left me unable to spot the wavering edges of the illusion presented before me.

    The ancient curses surrounding the evils of different tiers changing at different times never seem to show up in the ways the old ones spoke of.

    Instead of a torrent of changing DB systems and continual refactoring of all tiers in an effort to extract the very last drip of performance, events tended to peak and trough.

    Long periods of calm would happen in which everyone seemed to almost hold their breath in the hope that if they didn't touch anything then it wouldn't break.

    And then, every once in a while, change would erupt from the business requirements and wash across all the tiers at once.

    Suddenly people were facing daemons that the ancients never mentioned. Panicked masses running through the streets crying out questions like "How do keep the version of the DB inline with the version of code?", "How do we test each version?" and "How do we roll out versions side by side?".

    I had grown up thinking that the only way that SQL could execute efficiently was via the protection and guidance provided by stored procedures. Without the stored procedure, what was there?

    A lawless town of missed cache hits, fumbling predicates and roaming hordes of developers feasting at the gory remains of relational theory?

    As it turns out, probably not: http://www.databasejournal.com/features/mysql/article.php/3525581  :)

    评论

    请稍候...
    很抱歉,您输入的评论太长。请缩短您的评论。
    您没有输入任何内容,请重试。
    很抱歉,我们当前无法添加您的评论。请稍后重试。
    若要添加评论,需要您的家长授予您相应权限。请求权限
    您的家长禁用了评论功能。
    很抱歉,我们当前无法删除您的评论。请稍后重试。
    您已超过了一天之内允许提供的评论数上限。请在 24 小时后重试。
    因为我们的系统表明您可能在向其他用户提供垃圾评论,您的帐户已禁用了评论功能。如果您认为我们错误地禁用了您的帐户,请联系 Windows Live 支持部门
    完成下面的安全检查,您提供评论的过程才能完成。
    您在安全检查中键入的字符必须与图片或音频中的字符一致。

    若要添加评论,请使用您的 Windows Live ID 登录(如果您使用过 Hotmail、Messenger 或 Xbox LIVE,您就拥有 Windows Live ID)。登录


    还没有 Windows Live ID 吗?请注册

    引用通告

    此日志的引用通告 URL 是:
    http://lzcd.spaces.live.com/blog/cns!B40A5E3E8E32C4EC!141.trak
    引用此项的网络日志