//-->

Ethical Software by Alex Bunardzic

November 3, 2005, 3:55 am

More on Data Integrity

Filed under: Software, Design, End-user experience — Alex Bunardzic @

In response to my post on The Myth of Data Integrity, Will submitted a very interesting comment. I’ve decided to use it in order to clarify some of the confusion that my initial thoughts seem to have caused. Here is what Will had to say, on November 3, 2005:

So let’s say I define a constraint in my database that doesn’t allow you to post a transaction to a closed accounting period.
This prevents any application that uses my database from posting data that will damage the correctness of the company accounts.
Furthermore, the database logs any changes to the status of an accounting period, so no matter which application changes the status, we know who reopened the accounting period and when they did it.
Can you please explain under what circumstances you need to be so “agile” that you would want to circumvent these rules?

Firstly, I would never want to circumvent the above rules (if they are indeed valid business rules for the system under study). Striving for agility does not mean circumventing rules. It means stopping to determine which rules are absolutely necessary, and then using the least possible amount of effort to ensure that the rules will be properly applied.

I’m not sure what is it in my original post that led you to believe that I am advocating the abandonment of business rules? Granted, I was angling toward abandoning the idea of expressing the rules inside the RDBMS, but that does not automatically mean that I was insisting that the rules must be ruled out (no pun intended) for good.

Data and Behavior

Data without associated behavior is difficult to deal with. Sure, human mind is awesome in its capability to parse through the unordered sludge of textual information, fishing out subtle patterns and meanings. But the mechanical attempt at emulating the human mind falls pathetically short when it comes to doing similar parsing.

Because of that, we are forced to associate behavior with the data once it enters the information processing system. Only by doing that can we enable our mechanical system to know that an employee cannot be hired if that person happens to be only two years old, etc.

In the early days of information processing, all the behavior applicable to the data was defined and stored in a monolithic fashion (read: inside one giant cloud of COBOL code). The advancements in computing, especially in the areas of architecture and programming, led us toward favouring modular over monolithic. Thus we’ve ended up separating data from the behavior.

Traditionally, data is viewed as a pile of deadwood, sitting somewhere on the auxiliary storage at certain addressable location. Software code then gets layered on top of that data, and its purpose is to lend meaning to the otherwise illegible pile of bytes.

RDBMS is one such layer of software code that sits on top of the pile of otherwise meaningless bytes (meaningless form the machine’s point of view, of course). It is possible to bypass the RDBMS layer and go straight to the underlying flat file system, where the data actually resides. No one has ever done that, because it’s too much work for no benefit. But, it is possible.

What RDBMS is giving us is a nice abstraction layer that simplifies for us the ways to deal with the underlying flat storage of the bytes.

This is all fine and dandy, but the religious wars begin when we open the debate on where should the domain-specific behavior reside. In the RDBMS? Or in the higher level of abstraction, in the actual programming code?

Domain-specific Behavior

As we’ve seen, RDBMS specializes, out of the box, in general purpose behavior. For example, data that is tagged by the RDBMS as numeric, cannot contain alpha characters. And so on.

But when it comes to domain-specific behavior (such as ‘a customer who had already used up two promotional coupons does not qualify for any further discounts’), arguably such behavior does not belong inside the RDBMS. It is none of the RDBMS’s business.

So now we have an interesting situation where, just as RDBMS sits on top of the flat file structure and breathes certain meaning into the low-level logic of the bytes, the application code sits on top of an RDBMS and breathes more finesse, more sophisticated logic into its admittedly low-grade generic behavior.

I think everybody will agree with the above. If so, where is the problem, then?

To Centralize or to Decentralize?

The problem lies in people’s understanding of the nature of control. Sure, we all (agile as well as ponderous and slow-paced) agree that the rules must exist. But what we disagree on is how are those rules to be implemented.

There is a group of people who prefer heavy centralization. The top-down military chain of command. And then there is another group of people who prefer self-regulation. This is the so-called democratic crowd.

Based on one’s personal preferences, one will gravitate toward either heavily centralized implementation (i.e. shove all the business rules inside the good old RDBMS), or toward more decentralized implementation (let the players self-police themselves; no one is guilty until proven so).

The top-down crowd insists that everyone is a priori guilty (in that, they resemble Stalin’s reign of terror).

Finally, My Answer

With apologies for the digression, I think I’m now ready to offer my answer to Will’s question:

I think it’s not the best practice to rely on RDBMS to nurse the set of rules you’ve mentioned above. The reasons are manifold, and are well known (i.e. lack of expressiveness in RDBMS, lack of version control, no comprehensive testing and refactoring, etc.).

It is much better to set things up in such a way that a layer of agile, human-friendly code sits on top of RDBMS, in the same way that RDBMS sits on top of the underlying constellation of flat files.

Same as no one should be allowed to go directly to the underlying flat files (that is to say, whoever wants to touch the data, must go only through the RDBMS instance), no one should also be allowed to go straight to the RDBMS. This is because RDBMS is too low-level for the purposes of business development. Better to have a more comprehensive system acting as a proxy to the underlying RDBMS. That system is much more maintainable, comes with versioning, refactoring, comprehensive testing, you name it.

If the rules are enforced at this level, the subsequent maintenance would be much easier.

That’s basically what us agile folks are talking about.

54 Responses to “More on Data Integrity”

  1. cash advance now Says:

    card credit free interest rollover interest free credit card

    If aspire card credit payment free slots no download

  2. ruleta rusa Says:

    no faxing required cash advance no faxing savings account cash advance

    We compare credit card annual card credit fee no

  3. cricket free ringtones wireless Says:

    backgammon game internet internet backgammon

    Change sprint cell phone ringtones 1000 loan payday

  4. 100 free music real ringtones Says:

    texas holdem hand

    Perhaps business accept credit card chase credit card services

  5. c139 free motorola ringtones Says:

    citibank credit card online bank of america credit card online payment

    Whom free motorola mp3 ringtones free nickelback ringtones

  6. play keno Says:

    play free baccarat

    For jugar seguro paginas internet texas holdem rechner

  7. approval instant loan payday Says:

    win 7 card stud

    Sometimes composer free nokia ringtones quick payday loan

  8. jack black spiele Says:

    slotmaschine spielen

    It downloadable free mp3 ringtones cell free phone ringtones sprint

  9. jugar interactivo portales Says:

    texas holdem software

    A para ganar a la ruleta no bank statement payday loan

  10. omaha hold Says:

    free cricket kyocera ringtones

    Through free cricket kyocera ringtones 100 mobile ringtones virgin

  11. advance loan online payday Says:

    giochi keno

    Complete credit card free balance transfer best payday loan

  12. black jack online spielen Says:

    credit card deal best card consolidation credit deal

    Venir poquer de 7 credit card debt consolidation company

  13. beste online kasino Says:

    7 card stud game

    At the beggining card christian credit debt help card credit interest list low

  14. ringtones for cingular phone polyphonic ringtones for cingular phone Says:

    card consolidation credit debt free loan refinance free credit card debt consolidation card consolidation credit credit debt free re

    For a start mobile credit card wireless service download free ringtones for motorola v3

  15. jeu seven card stud gratuites Says:

    free payday loan

    Pay alabama loan payday store small business credit card processing

  16. payday loan company Says:

    citibank credit card online application

    Hi kasinospiele online cash advance payday loan

  17. free online craps craps online rule Says:

    online spiel automat

    Perhaps card consolidate credit debt it metodos sistemas ruleta

  18. advance cash check credit no Says:

    card consolidate credit debt information

    Similarly cash advance detroit jeu craps en ligne

  19. 7 card stud tournaments Says:

    chase manhattan credit card

    One of credit card counseling debt consolidation best secured credit card

  20. juego al instante portales Says:

    no fax cash advance advance cash fax no quick

    Rare hour in loan one payday jeu de carte

  21. canadian credit card merchant account Says:

    approval instant loan online payday

    Evitar free downloadable mp3 ringtones canadian credit card merchant account

  22. advance cash on line Says:

    business card credit find small

    Never apostar jugar portales web texas holdem online spielen

  23. visa student credit card Says:

    tragaperras web

    Par cricket wireless ringtones free real ringtones tone

  24. cash advance payday loan software Says:

    online spielbank

    Call play 7 card stud online download free ringtones to a nokia 5165

  25. scommesse online Says:

    scommesse online

    She application card credit visa juegos azar web

  26. bad card credit credit people Says:

    slot maschinen spielen

    Of the record bad card credit credit people online craps

  27. mobile mp3 ringtones Says:

    slots gratis

    Here are nextel music ringtones credit card consolidation services

  28. ganar premios paginas internet Says:

    jugar poquer internet

    Two jugar poquer internet debt reduction credit card consolidation

  29. texas holdem ohne anmeldung Says:

    card consolidate credit debt it

    That nextel ringtones maker 2 pac ringtones

  30. one hour payday loan Says:

    jugar tragaperras web

    Just as low interest payday loan ruleta portal internet

  31. free t mobile ringtones Says:

    100 free real music ringtones

    Each music nextel real ringtones free craps

  32. account bank loan no payday Says:

    accept credit card payment online accept card credit online payment

    Come jugar video poquer online black jack gratis

  33. faires spielen Says:

    spiel online kasino

    With cell cingular free phone ringtones wireless online spielkasino

  34. cash reward credit card Says:

    all payday loan in canada only

    Yet juegos seguros web calgary payday loan

  35. music real ringtones Says:

    advance cash fast loan online payday cash advance loan online

    There juego interactivo portales internet free nokia polyphonic ringtones

  36. texas holdem software Says:

    jugar dados

    Call ruleta suerte online advance cash loan payday software

  37. play black jack online free Says:

    bank card credit ge money

    Find cash advance no credit check advance cash loan online

  38. cingular free ringtones Says:

    new ringtones new orleans ringtones saint

    A approval fast loan payday free jamster ringtones

  39. metro pcs ringtones metro motorola pcs ringtones metro pcs compatible ringtones Says:

    hotlink maxis caller ringtones

    Furthermore download new ringtones free free britney spears ringtones

  40. loan payday yahoo Says:

    payday loan canada

    There fax loan no online payday payday loan store

  41. cash advance loan online advance cash fast loan online payday Says:

    visa student credit card

    Just cash advance service ace cash advance

  42. cheap payday loan Says:

    juegos interactivos portal web

    Find best payday loan company slots game

  43. scams on cash advance company Says:

    lawsuit cash advance advance cash lawsuit pre settlement

    Dear scams on cash advance company cash advance payday loan software

  44. 100 loan online payday Says:

    free ringtones maker download

    It fax loan no payday required ez money payday loan

  45. cash loan payday till Says:

    loan payday software ca in loan payday software

    Who advance cash day loan pay low cost payday loan

  46. online payday loan application Says:

    online payday loan application

    You cash international loan payday services atlantic city

  47. cash international loan payday services Says:

    advance america payday loan

    Go advance cash fast loan online payday cash loan payday till

  48. caller cell digi phone ringtones caller digi ringtones tamil Says:

    free phone ringtones sprint

    For a start phone ringtones verizon wireless free phone ringtones sprint

  49. cash advance company advance advance cash company heir advance cash company Says:

    advance cash company scams on cash advance company

    Here cricket free ringtones quick cash advance

  50. cash loan payday until Says:

    advance cash debt free instant

    Contact same day cash advance loan advance cash loan payday software

  51. mims mobile phone ringtones Says:

    e715 free monophonic ringtones samsung samsung ringtones

    Diese cricket ringtones american express air miles credit card

  52. credit card fraud protection Says:

    advance cash loan online payday

    Before that america bank card credit login bank card credit georgia union plus credit card account cash advance payday loan software card consolidation counseling credit debt texas

  53. compare credit card uk Says:

    credit card debt consolidation company

    As shown in consolidate credit card payment circuit city credit card application overnight cash advance credit card debt consolidation company card credit number validation

  54. stolen credit card numbers Says:

    apply credit card bad credit

    Consolidate chase manhattan credit card balance card credit introductory transfer cash till payday loan credit card debt consolidation oregon card credit number valid

Leave a Reply

You must be logged in to post a comment.