In this lesson, you will learn how to design and enforce acceptable use policies (AUPs) that govern how developers interact with production database environments.
As an advanced database practitioner, you understand that governance isn't just about firewalls; it’s about defining the "rules of the road" for human access. When developers interact with production systems—often for troubleshooting or emergency hotfixes—the risk of accidental data modification or performance degradation is significant. An effective usage policy bridges the gap between operational agility and system stability.
Defining Acceptable Use
A robust usage policy should explicitly define what constitutes "acceptable" behavior. Rather than banning all access, focus on high-risk activities. Your policy should mandate:
- Read-Only Default: Access should be
READ ONLYby default. AnyINSERT,UPDATE, orDELETEoperations must be executed via an automated CI/CD pipeline, never manually. - Resource Throttling: Define session-level limits. For example, a policy might state that any interactive session must be terminated if it consumes more than 10% of CPU for longer than 60 seconds.
- Audit Trail Requirements: All manual queries must be logged, and potentially associated with a registered change management ticket ID.
Example: Enforcing Usage Constraints
You can implement technical controls that mirror your written policies. For instance, using a resource governor or session-level profile settings in SQL, you can restrict the impact of an ad-hoc session:
-- Example: Limiting session resources to enforce usage policy
ALTER RESOURCE CONSUMER GROUP 'DEVELOPER_GROUP'
SET SWITCH_GROUP = 'KILL_SESSION'
SWITCH_TIME = 30 -- Max 30 seconds for any query
SWITCH_ESTIMATE = TRUE;
The Human Element
An acceptable use policy is ineffective if it lives only in a document. It must be communicated during developer onboarding and integrated into the access request workflow. When a developer requests production credentials, they should be required to digitally acknowledge the policy, confirming they understand that manual DML (Data Manipulation Language) is prohibited and that all sessions are subject to automated monitoring and audit.
By codifying these expectations, you transform "security" from a series of roadblocks into a predictable, shared framework for production health.
Key Takeaway: Managing database usage policies requires a combination of clear, written constraints on manual modifications and technical enforcement mechanisms that cap the resource footprint of human-initiated queries.