I did a lot of work to fully templatize and isolate the database primitives so that we could test cleanly, but it allows for a fairly simple replacement, and by mapping calls to a standard query language, SQL or otherwise, a driver model should provide easy access to any store.