inflearn logo

A Working DBA Team Lead’s Design for Concurrent Inventory Decrements — How to Keep the Database Running Under Event Traffic

See firsthand where the database gets bottlenecked by first-come, first-served coupons and inventory deductions, using lock waits, hot rows, history list length, and connection counts. From conditional UPDATEs, unique keys, and SKIP LOCKED to counter sharding and Redis-based decisions, this hands-on course by a practicing DBA team lead uses Docker-based scenarios to demonstrate the impact of design changes.

1 learners are taking this course

Level Intermediate

Course period Unlimited

MySQL
MySQL
Redis
Redis
SQL
SQL
aws-aurora
aws-aurora
Docker
Docker
MySQL
MySQL
Redis
Redis
SQL
SQL
aws-aurora
aws-aurora
Docker
Docker

What you will gain after the course

  • When first-come, first-served issuance and inventory deductions surge, identify bottlenecks using database metrics (row lock waits, total lock wait time, running threads, and history list length).

  • We compare FOR UPDATE, conditional UPDATE, and optimistic locking using database metrics under the same conditions to choose the best option.

  • Prevent duplicate issuance and duplicate retries with unique keys, statement ordering, and idempotency keys, while avoiding the pitfalls of `INSERT IGNORE`.

  • Pre-generated coupon code pools using SKIP LOCKED and single-row inventory using counter sharding can break through throughput limits.

  • Learn how to quickly return failures by managing undo accumulation in long transactions, connection counts and max_connections, and lock wait timeouts.

  • Read the event rehearsal as a second-by-second graph, then look up the same metrics by their Aurora CloudWatch and Performance Insights names.

This course

In first-come-first-served coupon issuance and inventory deductions, you’ll see firsthand where the database gets stuck by tracking lock waits, hot rows, history list length, and connection counts. This practical course, taught by a team lead and practicing DBA, uses 23 Docker-run scenarios to demonstrate the impact of design changes, covering conditional UPDATEs, unique keys, SKIP LOCKED, counter sharding, and Redis.

There are plenty of courses that introduce concurrency solutions. This course measures those same solutions from the database side. Each lesson follows the same sequence: code → run → row lock waits, total lock wait time, threads running, and rollback count → the fix → the same measurements. At the end, it rehearses a full 20-second event and reads it through the graphs a DBA would see.

What You’ll Learn

  • When first-come, first-served issuance and inventory deductions surge, identify bottlenecks using database metrics (row lock waits, total lock wait time, active threads, and history list length).

  • Reproduce over-issuance caused by a read-modify-write pattern, then compare FOR UPDATE, conditional UPDATE, and optimistic locking using database metrics under the same conditions to choose the best approach.

  • Unique keys, statement ordering, and idempotency keys prevent duplicate issuance and duplicate processing on retries, while avoiding the pitfalls of INSERT IGNORE.

  • Use SKIP LOCKED for pools of pre-generated coupon codes, and shard counters to overcome throughput limits when inventory is tracked in a single row.

  • Learn how to return failures quickly by managing undo buildup from long transactions, connection counts and max_connections, and lock wait timeouts.

  • Read event rehearsals using second-by-second graphs, then find the same metrics under their Aurora CloudWatch and Performance Insights names.

Who This Is For

  • Backend developers with 1–5 years of experience who are building first-come, first-served, coupon, limited-sale, or inventory features, or preparing for an event.

  • For those who have learned how to solve concurrency issues but are curious about “what it looks like in the database”ials

  • A tech lead who needs to assess database-side risks before an event.

Prerequisites

  • SELECT·UPDATE·INSERT and transaction basics (BEGIN/COMMIT)

  • Indexes and primary key concepts, launching a container with Docker (hands-on practice)

What’s Not Covered

  • Application architectures such as Kafka, caches, and queue servers

  • In-depth coverage of locking principles (gap locks and next-key locks) and deadlock analysis (locking and deadlocks lecture)

  • How to Write Spring Code

About the Instructor

I’m Joo Kyung-ho, with over 20 years of experience in databases and IT. As a DBA and DB Platform team manager, I work with database platforms and specialize in MySQL, PostgreSQL, Oracle, MongoDB, SQL tuning, AWS, Terraform, and Python.

At a large e-commerce company, I’ve monitored database metrics during first-come-first-served, coupon, and limited-sale events, working with the development team to improve the design. This course recreates that experience using only educational sample data and results from local Docker runs. No company production data was used.

The video narration is AI-generated speech. The code, SQL, and measurements shown on screen are results from actual executions in the hands-on environment.

Recommended for
these people

Who is this course right for?

  • Backend developers with 1~5 years of experience who are building first-come, first-served, coupon, limited-sale, or inventory features, or preparing for an event.

  • For those who’ve learned how to handle concurrency but are wondering, "What does it look like in the DB?"

  • A tech lead who needs to assess database-side risks before the event

Need to know before starting?

  • Basics of SELECT, UPDATE, INSERT, and transactions (BEGIN/COMMIT)

  • Concepts of indexes and primary keys, running containers with Docker (hands-on practice)

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

48 lectures ∙ (3hr 12min)

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

$52,800.00

20%

$51.70