inflearn logo

DBA Operations with AI Agents — Automating Database Checks, Tuning, and Scaling with Claude

I build a DBA agent right on my laptop in Docker that measures MySQL and PostgreSQL every morning, creates a diagnostic report with A/B/C/N letter grades, analyzes problematic queries with EXPLAIN and drafts improvement requests, and reviews plans and costs for scaling connections and Readers up or down before a sale.

1 learners are taking this course

Level Intermediate

Course period Unlimited

MySQL
MySQL
PostgreSQL
PostgreSQL
Docker
Docker
database
database
MySQL
MySQL
PostgreSQL
PostgreSQL
Docker
Docker
database
database

What you will gain after the course

  • Every morning, it automatically generates a self-contained HTML diagnostic report by collecting MySQL and PostgreSQL metrics as snapshots and assigning letter grades: A (Good), B (Caution), C (Risk), or N (Unable to Measure).

  • We identify slow-query candidates from the digest, slow log, and pg_stat_statements, mask SQL literals, and deduplicate them by fingerprint.

  • Run live EXPLAIN with a read-only account to diagnose full scans and planning errors, then draft an improvement request with supporting figures.

  • Create a decision engine that closes out 'We took action' reports only based on measured improvement (sample size, average, slow logs, and execution plan).

  • Compare the app Pod count × total connection pool size with max_connections, then plan and execute Reader scale-ups, traffic-blocking scale-downs, and cost changes with approval gates.

  • We probe migration SQL to check whether online DDL is possible, and leave review comments with severity ratings for bulk DML, N+1 queries, and missing indexes.

Final goal — by the end of the course, you’ll have built and be running an agent that measures your database and reports back every morning.

Every morning, the agent measures MySQL and PostgreSQL, creates an HTML diagnostic report with A, B, C, and N letter grades, identifies problematic queries and diagnoses them with EXPLAIN, drafts an improvement request, and, ahead of the regular sale (Season-Off Festa), reviews the total app connection pool size against max_connections and plans and costs for scaling Readers up or down.

24 video lessons · approximately 2 hours and 30 minutes · 24 hands-on scenarios. In Lesson 0, I’ll first show you the completed system running in practice. Then, in the final capstone, you’ll build the same system yourself and verify it with a grading script.

Who This Is For

  • DBAs who manually review dashboards and slow logs every morning

  • Backend developers who operate databases themselves (and worry that connections might spike during a sale)

  • "I want to try automating operations with AI agents," but I’m wary of AI making up incorrect numbers.

What Makes This Course Different

  • Code makes the decisions; Claude explains them. Measurements and rules (code) determine the grade and whether a request is resolved; the LLM only writes explanatory sentences. If the LLM includes a number not supported by the evidence, it is automatically rejected.

  • If it can't be measured, N. For items that can't be measured because they aren't connected or you don't have access, don't fill them in with estimates; record them as N (not measured) + the reason.

  • An improvement-rate assessment that doesn’t take “We’ve taken action” at face value. After the action report, remeasure the sample count, average improvement rate, slow logs, and execution plan to determine whether to close the issue, remeasure, or defer the assessment.

  • Operational changes require human approval. Reader scaling up or down can only be executed with an approval file. If lingering connections do not drain within the time limit during scale-down, it automatically rolls back and stops.

  • Run every exercise in Docker on my laptop. Follow along from start to finish without a cloud account or API keys, using MySQL 8.0 (1 Writer + 2 Readers), PostgreSQL 16, HAProxy, and virtual data (2 million orders). Connecting Claude is optional.

  • More than 60% hands-on practice: “Follow along → Check the results → Deliberately break things.” Every number on screen comes directly from actual execution logs.

What You’ll Learn

Section

Contents

0. Final Goal

Completed System Demo

1. Hands-on Environment and Safety Principles

Replication/proxy environment, read-only agent account, masking secrets, connecting Claude Code (CLAUDE.md, permissions, skills)

2. Morning Database Diagnostic Report

Metric snapshot, letter grades (A·B·C·N), slow logs·pg_stat_statements, explaining causes with numbers, HTML diagnostic report

3. Slow Queries → Improvement Request

Candidate extraction, SQL literal masking and fingerprinting, safe live EXPLAIN, diagnostic rules (including misjudgments about query plans), deduplication of improvement requests, and improvement-rate evaluation.

4. Capacity Planning for the Season-Off Festival

Pod count × pool size vs. max_connections, decision on scaling up or adding Readers, blocking incoming traffic, draining lingering connections, and separating connections (maxLifetime), rollback on failure, and cost calculation

5. Schema Change Review

Online DDL probe (INSTANT·INPLACE·COPY, PostgreSQL rewrites), bulk DML, N+1 queries, missing indexes, and review comments by severity level

6. Automation and Capstone

Daily morning automated runs, approval gates, and the entire Festa rehearsal process.

Hands-On Environment

  • MySQL 8.0.44 · PostgreSQL 16.11 · HAProxy 3.0 · Python 3.12 agent (all running in Docker, with pinned image tags)

  • A fictional all-in-one sports and outdoor goods store, “Loop Market”: 300,000 members · 2,000,000 orders · 1,000,000 coupons issued · 200,000 products · 1,000,000 review rows (generated using fixed rules—everyone gets the same data)

  • Hands-on materials (zip): docker-compose, seed SQL, complete agent code (including unit tests), scenario scripts for each lesson, practice problems and answers, and Claude Code configuration examples

Prerequisites

  • Basic SQL (SELECT, JOIN, and index concepts); experience using MySQL or PostgreSQL.

  • Comfortable enough to copy and run commands in a terminal. Basic Python reading skills are sufficient.

Notice

  • The narration is AI-generated. The numbers on screen and in the audio were checked against the records of the instructor’s own runs.

  • Loop Market and all data and events are fictional and for educational purposes. Times and cumulative values may vary by computer; as long as the letter grades, plan format, and assessment are the same, that is normal.

  • Please post your questions in the lecture Q&A.

Regular price: 100,100 won (including VAT) → Sale price after 20% discount: 80,080 won

Recommended for
these people

Who is this course right for?

  • A DBA who manually reviews dashboards and slow logs every morning

  • A backend developer who manages MySQL and PostgreSQL firsthand and worries about database connections during sales periods

  • An engineer who wants to automate operations with AI agents but worries that AI will make up incorrect numbers.

Need to know before starting?

  • Basic SQL knowledge (SELECT, JOIN, and index concepts) and experience using MySQL or PostgreSQL.

  • Enough to copy and run commands in the terminal (for Python, being able to read it is enough).

  • A personal PC capable of running Docker (with at least 6 GB of memory allocated to Docker). No cloud account or API key required.

Hello
This is dorian05202988

Career Verified

A data craftsman with over 20 years of experience in databases and IT. As a DBA and manager of a DB Platform team, I work with database platforms and specialize in MySQL, PostgreSQL, Oracle, MongoDB, SQL tuning, AWS, Terraform, and Python. Drawing on experience in the gaming, finance, and IT services industries, I explain database and cloud architecture. I have published 『Oracle Practical Tuning: Learning SQL Patterns』 and 『Oracle Pro*C Practical Project Guide』, and have presented on serverless architectures, database selection, and multi-database strategies at AWS Summit 2018 and 2019 and DataYa Nolja 2020. Recently, I have been working on slow-query analysis and tuning recommendations using Bedrock LLM, automated DB specification sizing, and query workflows through a DB metadata MCP server and Slack bot. I explain database automation for developers and AI applications for non-developers through hands-on exercises tailored to the audience and objectives of each course. Rather than applying AI suggestions as-is, I teach a decision-making framework that verifies result equivalence, execution plans, and observability conditions, and defers action when the supporting evidence is insufficient. Company operational data and credentials are not included in the course materials.

More

Curriculum

All

24 lectures ∙ (2hr 30min)

Course Materials:

Lecture resources
Published: 
Last updated: 

Reviews

Not enough reviews.
Please write a valuable review that helps everyone!

dorian05202988's other courses

Check out other courses by the instructor!

Similar courses

Explore other courses in the same field!

Limited time deal

$10,055.00

20%

$77.00