[wp-hackers] Making WordPress database independent

Brian Layman wp-hackers at thecodecave.com
Mon Feb 7 16:27:00 UTC 2011


On 2/7/2011 9:09 AM, Piyush Mishra wrote:
>>> On Mon, Feb 7, 2011 at 8:44 AM, Piyush Mishra<me at piyushmishra.com>  wrote:
>>>> Is there any reason for wordpress to be completely dependent on MySQL?If not, why dont we work on making it dbms independent ?
>>> WordPress allows for its database abstraction layer (the wpdb class) to be extended or replaced.
>>
> Nacin,
> Great! but arent the sql queries present all over the files?
>
You're right, flavors of queries can cause issues, but the queries in 
the core are pretty generic. Supporting both MyISAM and InnoDB helps 
keeps them that way.  I wrote a WordPress abstraction layer for 
Interbase/Firebird back in 2006 just to see how it was done and the only 
hangup I had was that WordPress expects to get record counts returned 
along side query results and Firebird did not do that.  I added an extra 
function to handle that and was on my way.

Plugins are another issue. You will likely have problems with the 
specific purpose plugins where developers just went in and got the job 
done, ignoring the API for whatever reason they had at the time.

In the end, with a vast vast majority of servers having MySQL installed 
as their database engine, the question isn't "Should we depend upon 
MySQL?", but "Does anyone see enough bang for the buck for them to 
maintain another engine for 5+ years?".  Microsoft obviously did and was 
able to create the code to do it. Engines like Firebird are open sourced 
and would have allowed MUCH more sophisticated database handling years 
earlier. There are still queries in MySQL that cause me to beat my head 
on the table top because they were soooo much more easily done in 
Firebird even a decade ago, but there simply isn't an outcry for other 
DB engines.  What we have works and works well.

-- 
Brian Layman
http://eHermitsInc.com
Managed WordPress Hosting



More information about the wp-hackers mailing list