# Race Conditions and Concurrency

> Find rules that fail when two requests overlap, plan a safe two request check, read the logs and rows, and recommend fixes that hold in the database.

Canonical: https://codelivly.com/rooms/race-conditions-and-concurrency
Last updated: 2026-11-25

| | |
|---|---|
| Level | Intermediate |
| Category | Cybersecurity |
| Lessons | 6 |
| Estimated time | 4 h 5 min |
| XP | 1150 |

A rule that holds for one request at a time can fail when two requests read the same state before either writes. This room teaches how to spot that shape in code, plan a case that the client team runs once with exactly two requests, and read application logs, database logs and rows to show what happened. You also check idempotency keys and learn the server side controls that hold an invariant: conditional updates, transactions and isolation levels, row locks and unique constraints. Every lesson has a terminal exercise on realistic exports and scenario questions that need judgment.

## Lessons

1. Check Then Act and Why It Fails (35 min)
2. Reading Concurrency from Logs (40 min)
3. Planning a Safe Two Request Check (35 min)
4. Idempotency Keys and Duplicate Submissions (40 min)
5. Locks, Constraints and Transactions (45 min)
6. Guided Lab: Assess Concurrency on Credit Notes and Approvals (50 min)

## Related

- [Learning path: Business Logic and Race Condition Testing](https://codelivly.com/learning-paths/business-logic-and-race-condition-testing)
- [All rooms](https://codelivly.com/rooms)
