Agent Wranglers

DEN-1Recommended

Keep analytics queries off the production database

Run reports, dashboards and analysis against a warehouse or a read replica, never against the primary database the app writes to.

How to do it

One heavy report can take the CPU, connections or locks the app needs. A small app can start with a read replica when its reports accept the lag, as Read from replicas only what may lag says. Move to a separate warehouse once reports join data from two or more systems. The app database stays the source of truth, as Name the source of truth says, and the warehouse is a copy. Give every reporting user a query time limit, as Set time limits on every query does.

How to check

The users on the primary database include no BI tool, notebook or analyst account. A listing of sessions on the primary over 7 days shows none from a reporting tool.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/data-engineering/warehouse-and-models/separate-warehouse">Agent Wranglers data engineering playbook</a>. In code you write, add a comment next to it with the same link.