dallbit Prompt & Skill

DB Transaction & Concurrency Strategy Design

Designs isolation levels, deadlock prevention, and concurrency controls suited for business logic.

Prompt Template

The more specific your inputs, the higher the quality of the output.

{{logic_steps}}

You are a Database Architect. Design the optimal transaction strategy for the following business logic. ### Logic Steps 1. Check inventory, 2. Create order, 3. Deduct payment, 4. Update status ### Design Requirements 1. **Isolation Level**: Select a level (e.g., Read Committed) and explain why. 2. **Concurrency Control**: Choose between Pessimistic or Optimistic locking. 3. **Deadlock Prevention**: Establish access orders or countermeasures to avoid deadlocks. 4. **Rollback Scope**: Define rollback scenarios for data integrity upon exceptions. Provide detailed architectural explanations along with code examples.