An Introduction to Class::DBI - Bonus Material 41

Constraints and Data Integrity

  • ACID:

    • Atomicity, Consistency, Isolation, Durability

    • Application visible features: Transactions, Constraints, Row Level Locking

  • With database-heavy applications we have the option of dealing with table relationships at the DB level or at the application level:

    • Database Level logic:

      • PRO: Database does all the heavy lifting

      • PRO: Rock-solid data integrity

      • CON: Not all databases support all aspects of it (MySQL pre 4.0, Postgres pre 7.0)

      • AND... if we make a mistake, we still have to figure out what went wrong at the application level

    • Application Level logic:

      • CON: We have to do all the heavy lifting

      • PRO: More choice of databases, can deal with many environments

      • PRO: Our SQL will be less complicated

      • PRO: We can still leave constraints on at the Database level, so the DB sanity checks our application logic.

 

YAPC::Canada << Previous | Index | Next >>
Copyright © 2003 Michael Graham