[wp-hackers] On Database Abstraction, Agnosticism, etc.

Robert Deaton false.hopes at gmail.com
Sat Mar 24 04:05:50 GMT 2007


Because I feel like I have been repeating myself and others /a lot/
lately on threads about porting WordPress to xxxx-database for
xxxx-reason, here's a thread on my take on methods and such for
porting WordPress or transforming it to work with another database or
whatever.

1). WordPress's concept of time will need to be rewritten for almost
all alternate databases. Just keep this in mind.

2). True database abstraction stands almost no chance whatsoever,
especially most established packages.

PearDB, Adodb, etc, are all exceedingly slow. They would definitely
allow true database abstraction, for any database to be dropped in,
but they are simply slow, slow, slow. And bulky. They stand almost no
chance at all of ever making it into the WordPress-core, and my bet is
that you will never convince anyone to change their mind.

Now, there are very simple ways for abstraction that might stand a
chance. Some people have suggested just some simple select and insert
functions. This could work, but it comes at a price, a price that is
difficult. It comes at the cost of losing support for using SQL
functions in the queries, especially since many would be database
specific. Basically, it may cost us convenience and speed in some
places. It'd be a hit, but it wouldn't be quite as hard to convince
everyone that it is a worthy trade, if a sufficient system could be
built.

3). Myth: Plugins that use their own SQL can't work with a port.

http://www.orablog.org/ is living proof of the opposite.

4). wp-content/db.php

A very, very simple way of completely replacing the database access
layer. It could be used to provide a translation table for queries,
maybe for plugins as well. It could also do any sort of regexps to
transform queries for use with another database too, or really
anything else.

I have more, but I'm tired and still have the flu.

-- 
--Robert Deaton
http://lushlab.com


More information about the wp-hackers mailing list