[development] DB support as contribute: is it a good idea?

Ivan Sergio Borgonovo mail at webthatworks.it
Wed Feb 13 12:52:58 UTC 2008


On Wed, 13 Feb 2008 16:52:32 +0800
Edison Wong <hswong3i at edin.no-ip.com> wrote:

> By the way, together with the decision of Drupal 7.x + PDO, there
> is also some voice about moving PostgreSQL (and so other potential 
> databases support, e.g. Oracle, DB2, MSSQL, etc) support away from
> core, but contribute; on the other hand, add official SQLite
> support into Drupal core, together with MySQL.

Perfect... put support for any other DB other than MySQL in
contrib *but* provide a serious abstraction layer that let people
write contrib to support *more than 2* DB ;)

That just move the problem from providing an API to providing an SPI,
making it worse.

Once you decide to go the SPI way... you've to design it in a way
that anyone can add support for his beloved DB.
You're not in charge of what DB will be plugged nor how.
Surely you won't have to develop the plug-in for each DB... but
you'll have to provide support without knowing what will get in those
plug-ins.

Everyone that is serious about DB AL should know that a) it's not
easy b) it is a matter of compromises.
If you don't compromise (performance, # of supported DB, delegation,
level of abstraction, extensibility, schedule...), you don't get the
DB AL.

Writing an SPI has its pros and cons.

Pros:
MySQL fans won't encumber core with MySQLism that sometimes make it
hard to support other DB.
PG fans then will have to write their own plug-in, and if they don't
it is up to their business, and if they do, they will do it in an
independent way from MySQL people *and* with a *serious* SPI most of
the time they will have to cut&paste code from the MySQL plug-in and
rewrite few lines.

Cons:
It is a harder work. It will have to be even more abstract and
radical.
We will have to extrude current support for the DBs and turn it into
plug-ins.
Unless we want to see a lot of code duplication we will still have to
write a basic API and the plug-ins will override just few methods.
So... anyway before we get to an SPI that is worth to have we will
have to pass through a better API.

So... let's work for putting pg support in contrib for drupal 9.

-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it



More information about the development mailing list