Managing Data Integrity
Simple Solutions for Lightweight Database Servers
By Brian Jepson
If you're building a Web application on Linux (or UNIX) with an SQL back end, you might be bewildered by the vast array of databases you could use: Mini SQL, MySQL, PostgreSQL, Oracle, Sybase, Informix, or DB2, to name a few. The heavyweight commercial databases are recent arrivals in the Linux world, but they've been around on UNIX for a long time. All of these databases are supported by Perl's Database Interface (DBI) module, and many of them work well with other languages used for Web development, such as Tcl, Python, and PHP.
While it may be tempting to choose a database based on factors such as memory footprint, cost, stability, and source code availability, there are many other important considerations. If you're going to trust one of these database servers with your data, you should consider how well it will take care of that data. Or, more importantly, what can you do to guarantee that it will take good care of your data?
The heavyweight commercial databases have a lot of support for data integrity and concurrency control, which can make it easier to ensure that your data doesn't turn into a mess of unmanageable and incorrect gibberish. But a free, stable database such as PostgreSQL has just about every feature (and then some) you'd expect in a commercial product, and even MySQL, a lightweight database, has certain features that can make it easier to manage the integrity of your data.
In this article, I'll look at some things that can go wrong with data integrity and concurrent access to data.