[TYPO3-dev] Get a quicker DBAL

Ernesto Baschny [cron IT] ernst at cron-it.de
Tue Aug 24 22:38:55 CEST 2010


Hi Xavier,

thanks a lot for that feature. Do you mind placing the info you wrote
below somewhere on the forge wiki? [1]. Then we could link that in our
release notes of alpha1 and more people would be looking over it.

Maybe you could also add some more infos about the current state of the
API, and how to use it. That could be a "work in progress" documentation
that can be then later on merged into the core APIs (as soon as 4.5 is
released).

Only if you have the time, of course! ;) Thanks!

Cheers,
Ernesto

[1] http://forge.typo3.org/projects/extension-dbal/wiki


Xavier Perseguers schrieb am 24.08.2010 22:30:
> Hi,
> 
> With the upcoming release of TYPO3 4.5 alpha1, prepared queries are
> starting to be used in Core.
> 
> If you are currently using DBAL, you are encouraged to checkout the
> QueryCache branch:
> 
> https://svn.typo3.org/TYPO3v4/Extensions/dbal/branches/QueryCache
> 
> (save it to typo3conf/ext/dbal to override the system extension version)
> 
> You will already get a slightly quicker TYPO3.
> 
> The idea is simple, for each prepared query DBAL sees, it caches it!
> This means that once a prepared query has been seen previously, the
> parsed and remapped prepared query is used instead resulting in a
> performance gain! Straightforward, isn't it?
> 
> The DBAL caching framework works either with TransientMemory or with
> Memcached. In fact, it may use another backend for caching but it would
> then make no real sense I guess.
> 
> 
> When using TransientMemory (default option when nothing else is
> configured), queries are cached for the current request, allowing
> prepared queries that are issued more than once to be reused. When using
> Memcache, best option, queries are cached from one request to the other,
> making it much better.
> 
> 
> To use it, edit localconf.php:
> 
> $TYPO3_CONF_VARS['SYS']['useCachingFramework'] = 1;
> $TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['dbal'] = array(
>         'backend' => 't3lib_cache_backend_TransientMemoryBackend',
>         'options' => array(
>         ),
> );
> 
> Note: you may omit the configuration at all, as long as
> useCachingFramework is active, caching will default to
> t3lib_cache_backend_TransientMemoryBackend
> 
> For memcached, use:
> 
> $TYPO3_CONF_VARS['SYS']['useCachingFramework'] = 1;
> $TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['dbal'] = array(
>         'backend' => 't3lib_cache_backend_MemcachedBackend',
>         'options' => array(
>                 'servers' => array('localhost:11211', 'otherhost:11211',
> 'thirdhost:11211'), // port is mandatory!
>         )
> );
> 
> You need to have memcached installed as a daemon and also as a PHP
> extension!
> 
> 
> Remember that prepared queries are the key for a quicker DBAL. As such
> you are both encouraged to provide prepared query patches for the Core
> and of course review the upcoming RFCs on that topic.
> 
> And above all, do not hesitate to report success or failure you have
> with this enhanced DBAL.
> 
> Cheers
> Xavier




More information about the TYPO3-dev mailing list