Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Direct database calls are strongly discouraged in Drupal 8. They limit backend swapability, and do not necessarily grant performance advantages sought. We use direct database calls extensively in the flag counts API, since a config or content entity was deemed Not The Right Thing.
Proposed resolution
Replace calls to the database with the Drupal 8 Cache API using tags.
Examples here: https://api.drupal.org/api/drupal/core%21modules%21system%21core.api.php...
Remaining tasks
Create patch.
User interface changes
None.
API changes
The API should remain unchanged, but no table will be available.
Comments
Comment #1
socketwench CreditAttribution: socketwench commentedPostponed out of the gate for https://www.drupal.org/node/2467413
Comment #2
joachim CreditAttribution: joachim commentedIsn't this sort of what I suggested ages ago?
If we change the flag counts to be cached data, then we need to change how we use them.
Comment #3
socketwench CreditAttribution: socketwench commented