The service 'config.storage.active' is backend overridable, only the class is hardcoded in multiple locations

Created on 21 April 2021, over 3 years ago
Updated 30 October 2023, about 1 year ago

Problem/Motivation

The service 'config.storage.active' is backend overridable, only the class is hardcoded in multiple locations. The class \Drupal\Core\Config\DatabaseStorage is implementing the service is using hardcoded SQL string queries. The problem is that MongoDB does not do SQL queries and therefore needs to override the class \Drupal\Core\Config\DatabaseStorage. Only with the hardcoded class in multiple places makes this impossible. Like in: \Drupal\Core\Config\BootstrapConfigStorageFactory, \Drupal\Core\Config\ExportStorageManager and \Drupal\Core\Config\ImportStorageTransformer. The last 2 class are also final classes and therefore cannot be overridden by a contrib database driver module or any other module.

Proposed resolution


New solution: change the SQL query to a DBTNG query. DBTNG queries are supported by the MongoDB database driver. The problem is that DBTNG always need to be converted to a SQL query. Therfor they will make Drupal a bit slower. The big question how much slower it will make Drupal and is that acceptable/can we live with?

Remaining tasks

TBD

User interface changes

None

API changes

Data model changes

None

Release notes snippet

None

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
ConfigurationΒ  β†’

Last updated 2 days ago

Created by

πŸ‡³πŸ‡±Netherlands daffie

Live updates comments and jobs are added and updated live.
  • Contributed project blocker

    It denotes an issue that prevents porting of a contributed project to the stable version of Drupal due to missing APIs, regressions, and so on.

  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β†’ as a guide.

    public function getConfigDatabaseStorage($table)
    1. should be typehinted

    This will need a test case to show the issue.

    Will then need a change record to announce the new function.

  • πŸ‡³πŸ‡±Netherlands daffie

    I have talked to @alexpott and the whole idea is not to the config database storage class backend overridable. Therefor to make it work for MongoDB the class should change to only use the DBAL. @alexpott can live with that change on the condition that it does not make Drupal slower. It allways be a bit slower, because a DBAL query needs to be converted to a SQL query. Now it is already a SQL query. The big question how much slower it will make Drupal and is that acceptable/can we live with?

  • last update over 1 year ago
    29,881 pass
  • πŸ‡³πŸ‡±Netherlands daffie

    Changed DBAL to DBTNG.

    @fgm: Thanks!

Production build 0.71.5 2024