Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295572

[policy] Decide whether to require json support for all database drivers for Drupal 10

$
0
0

Problem/Motivation

  • We currently store several serialized data structures in the database, such as {config}.data, {cache_*}.data, the Layout Builder data of per-entity layouts, and plenty others. Many of these would benefit from being serialized as JSON instead of PHP. #3046696: Move from serialized columns to JSON encoded data wherever possible, or use allowed_classes includes some discussion about this.
  • Nearly all modern relational databases now support a json datatype and corresponding JSON parsing functions that can be used during querying. If we could rely on this within our database system, then in following Drupal 10 minor releases we could add the APIs for efficiently querying these structures. For example, Drupal\Core\Config\Entity\Query\Query could be reimplemented as native queries by the database rather than its current implementation of in-memory PHP filtering only partially optimizable with a keystore. Or, Layout Builder could provide a way to query entities by aspects of its layout.

Proposed resolution

Require json support for all database drivers, both for the ones in core and for contrib/custom. This would mean:

  • For MySQL require at least 5.7.8; and for MariaDB require at least 10.2.7. See #3107113: [policy] Decide on MySQL/MariaDB/Percona Server version support status for Drupal 9.
  • For PostgreSQL require at least 9.4. See #3106077: [policy] Decide on PostgreSQL 9.x/10.x support status.
  • For SQLite, version isn't an issue, but we'd have to require that it be compiled with the json1 extension. This isn't the default, but (some? all?) Linux distributions include it in their build of it. For example, Ubuntu does. From PHP 7.4 sqlite uses the library on the system. Drupal 10 will require at least PHP 8.0
  • In contrib/custom space:
    • Microsoft SQL Server supports JSON beginning with version 2016. Mainstream support of earlier SQL Server versions has ended, but version 2012 still has extended support until 2022 and version 2014 still has extended support until 2024.
    • Oracle supports JSON beginning with version 12. Extended support of version 11 ends in Dec. 2020.
    • Any other SQL databases that we care about?

Remaining tasks

  • Decide if it's acceptable to require these minimum database versions.
  • Decide if it's acceptable to disallow SQLite usage for people whose SQLite is compiled without the json1 extension.

Viewing all articles
Browse latest Browse all 295572

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>