Description
This rule checks that a maintenance window is defined for each Managed Database cluster. The maintenance window is the day and start time during which DigitalOcean applies OS-level and database-engine updates; updates may begin at any point in the 4-hour period after the window's start time, and while updates run without downtime there can be brief periods of latency.
DigitalOcean assigns a default maintenance window when a cluster is created, and it can be changed. The rule confirms a window is set and recommends aligning it with the workload's lowest-traffic period so any brief maintenance latency lands outside peak hours.
Clusters whose maintenance window falls during peak business hours
Clusters where the window has not been reviewed against the workload's traffic pattern
Rationale
Maintenance operations can cause brief latency or reconnects. If the window sits during peak business hours, those brief interruptions hit the most users; scheduling it during the quietest period minimizes customer impact.
An explicitly chosen and communicated window also lets application owners plan for transient reconnects, rather than being surprised by platform maintenance at an arbitrary time.
Impact
Pros:
Maintenance-related latency lands during the lowest-traffic period
Predictable timing lets application owners plan around brief reconnects
No downtime for updates; only short latency during the window
Cons:
Requires knowing the workload's true low-traffic period across time zones
The window is a 4-hour range, not an exact minute, so timing is approximate
Global workloads may have no universally quiet hour
Default Value
DigitalOcean assigns a default maintenance window when a cluster is created; you can change the day and start time, and updates run during the 4-hour period after the start time.
Pre-Requisite
DigitalOcean Control Panel access with a role that can edit the maintenance window
Knowledge of the workload's lowest-traffic day and hour
A channel to communicate the window to application owners
Optional: a DigitalOcean API token or doctl authenticated (doctl auth init)
Remediation
Test Plan
Using the DigitalOcean Control Panel:
In the Control Panel, open Databases and click the cluster name.
Open the Settings tab and review the Maintenance Window section for the configured day and start time.
Pass: A maintenance window is set to a low-traffic day and time for the workload.
Fail: No window is configured, or the window falls during peak business hours.
Using doctl or the API:
Read the cluster's maintenance window.
doctl databases maintenance-window get <database-cluster-id>
curl -s -X GET "https://api.digitalocean.com/v2/databases/<database-cluster-uuid>" -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" | jq '.database.maintenance_window'
Pass if the maintenance_window object is present with a day and hour set to a low-traffic period. Fail if it is absent or set to a peak-hours slot.
Implementation Steps
Using the DigitalOcean Control Panel:
On the cluster's Settings tab, open the Maintenance Window section.
Choose the day of the week and the start time for the 4-hour window, picking the workload's lowest-traffic period.
Click Save.
Communicate the scheduled window to application owners.
Using doctl or the API:
Set the maintenance window with doctl or the maintenance endpoint.
doctl databases maintenance-window update <database-cluster-id> --day tuesday --hour 16:00
curl -s -X PUT "https://api.digitalocean.com/v2/databases/<database-cluster-uuid>/maintenance" -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" -H "Content-Type: application/json" -d '{"day":"tuesday","hour":"16:00"}'
Backout Plan:
Re-run doctl databases maintenance-window update (or PUT /maintenance) with the previous day and hour to restore the earlier schedule.
The window can be changed at any time and takes effect for subsequent maintenance.