[TYPO3-dev] DBAL - does it actually work

Jigal van Hemert jigal at xs4all.nl
Tue Nov 11 12:18:45 CET 2008


Michael wrote:
> Most extensions don't work cause people write strictly for mysql. So noone
> cares about coding guidelines. I did both: migrating and a new setup and
> both is a mess. Typo3's origin is with Mysql.

Apart from where the origin is, I don't believe that it's easy or even
sensible to write an application for multiple database backends without
losing performance and/or flexibility.

For example:
It was once decided that fe_users.usergroup can contain multiple user
groups as a comma seperated list.
In MySQL you can easily check for a usergroup by using WHERE
FIND_IN_SET(13, `usergroup`). Because other DBMSs do not have this
function (there may be comparable alternatives in other DBMSs) and to be
compatible with multiple DBMSs TYPO3 uses an ugly construction (something
like WHERE (usergroup LIKE '13' OR usergroup LIKE '13,%' OR usergroup LIKE
'%,13,%' OR usergroup LIKE '%,13') )
The same situation happens with access to pages and content elements. Can
you imagine when you have to check for multiple group IDs??

This could have been built in a different way which might have been a bit
faster for all supported databases, but it shows that supporting a lot of
databases is not easy. You limit yourself to only using the features which
are shared among all the supported DBMSs or you have to write a real
abstraction layer which produces specific queries for all the different
databases.

Which solution one might choose it will cost you performance. For some
time TYPO3 didn't use InnoDB and IIRC it still won't use fulltext indexes.
To get good performance from your database you need to do optimize table
layouts, indexes and queries.

Sorry for rambling :-)

-- 
Jigal van Hemert.





More information about the TYPO3-dev mailing list