This module is currently under development following the practice of Contrib First. It should be considered incomplete and under construction while in alpha release.
Features
The DKAN APIs allow users to query and filter datasets and provide a powerful tool for looking at public data. This power however has the potential to create some slow queries that tend to stack up. If the site is under significant bot or AI traffic, it is possible that the maximum number of allowed database connections may be exceeded. If that happens, the database goes away for all requests over that connection limit. Rather than let that happen arbitrarily, this module aims to dynamically activate the "Degraded service mode" already provided as a manual option as part of DKAN. This mode essentially limits the types of queries that can be made, to those that are not so complex or long running, while still allowing the site to function for most of its features.
Roadmap to MVP
- UI
- setting for number of max connections
- setting for the % of max connections that should enable protected mode
- setting to run this on cron or not
- disable automated mode (so it can be turned off without disabling the module.
- Write the status to a static json file when protected mode is enabled or disabled
- Write the file on module install
- Remove the file on module uninstall
- Log when protected mode is enabled or disabled including the number of connections measured.
- Drush commands
- check-status to run the check (so an outside task runner could run the check). - return the status on run.
- command to turn on or off the automated mode.
Requirements
This project requires the following modules:
-
DKAN: Datastore (
dkan_datastore)
Installation
Install as you would normally install a contributed Drupal module. For more information, see Installing Drupal Modules.
Using Composer:
composer require drupal/dkan_automated_protection
Post-Installation / Configuration
When this module is enabled, it provides settings for determining when or if it should enable DKAN's degraded service mode.
- Navigate to Administration > Configuration > System > DKAN Automated Protection (or the configured settings route once available).
- Configure thresholds for database connection monitoring and automatic degraded service mode activation.
- Save configuration.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
More in the Dkan ecosystem
Most installed first
Activity
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.0.x-dev | Dev | Sep 18, 2026 |