Tagged articles
optimistic locking
20 articles · Page 1 of 1
This article analyzes four concurrency control patterns — conditional updates, pessimistic locking, optimistic locking with version numbers, and distributed locks — using inventory deduction, order editing, and third-party push examples. It explains when each pattern applies, how to combine them with idempotency, and provides concrete SQL and Redis implementations.
Distributed LocksIdempotencyRedis
0 likes · 32 min read

Many developers think a REST API is complete after versioning, pagination, and validation, but real‑world production exposes hidden issues such as unsafe retries, concurrent updates, undocumented deprecations, and missing contracts; this article explains four senior‑engineer‑approved patterns—idempotency, optimistic locking, lifecycle management, and contract‑first design—to build APIs that survive production.
API Lifecycle ManagementIdempotencyREST API
0 likes · 8 min read

This article details the modular design of Flowable's core database tables, dividing them into five categories—Repository, Runtime, History, Identity, and General Data—and explains each table’s fields, types, and inter‑table relationships, including multi‑tenant support and optimistic‑locking mechanisms.
BPMNFlowableProcess History
0 likes · 17 min read

This article examines the challenges of using JPA optimistic locking for inventory deduction under high concurrency, demonstrates why naive retry logic can cause deadlocks and stale data, and walks through five progressively refined implementations that resolve transaction, caching, and isolation issues.
ConcurrencyJPARetry
0 likes · 13 min read

This article explains how to achieve idempotent order creation and updates by using unique request identifiers, database primary‑key constraints, Redis flags, and optimistic locking with version columns, thereby preventing duplicate orders and solving the ABA problem in distributed backend systems.
ABA problemIdempotencyOrder Service
0 likes · 11 min read

This article explains how to achieve idempotent order creation and updates in backend services by using database transactions, unique request identifiers, Redis flags, and optimistic locking with a version column to prevent duplicate submissions and solve the ABA problem.
ABA problemIdempotencyOrder Service
0 likes · 10 min read

This guide explains how to set up Spring Data R2DBC with Spring Boot, covering driver selection, dependency configuration, application properties, entity definitions, CRUD services, controllers, repository usage, and optimistic locking for reactive relational database interactions.
Database AccessReactive ProgrammingSpring Boot
0 likes · 9 min read

This article explains how to achieve idempotent order creation and updates in backend services by using unique request identifiers, database unique constraints, Redis flags, and optimistic locking with version columns, while also addressing the ABA problem with practical code examples and diagrams.
ABA problemIdempotencyOrder Service
0 likes · 10 min read

This article explains how to prevent duplicate order submissions and address the ABA concurrency issue by using database transactions, unique constraints, request identifiers, and version‑based optimistic locking to achieve reliable idempotent behavior in backend order services.
ABA problemDatabase TransactionOrder Service
0 likes · 10 min read


JavaEdgeSep 3, 2022 · Backend Development
This article explains why order creation and payment APIs must be idempotent, outlines practical techniques such as unique request IDs, database unique constraints, Redis flags, and version‑based optimistic locking to avoid duplicate orders and solve the ABA problem in distributed environments.
ABA problemDatabase TransactionIdempotency
0 likes · 9 min read

This comprehensive tutorial demonstrates how to integrate MyBatis-Plus with Spring Boot, covering basic setup, entity and mapper creation, CRUD operations, condition wrappers, pagination, logical deletion, automatic field filling, optimistic locking, and advanced features such as multi‑tenant and dynamic table name handling, complete with code examples.
CRUDMyBatis PlusPagination
0 likes · 46 min read

This article provides a step‑by‑step guide for using MyBatis‑Plus with Spring Boot, covering database and table creation, entity and mapper definitions, CRUD examples, automatic field filling, optimistic and logical deletion, performance plugins, query wrappers, and a code generator for rapid development.
CRUDMyBatis PlusSpring Boot
0 likes · 15 min read


JavaEdgeAug 17, 2020 · Backend Development
This article explains how to keep order services consistent across distributed systems by using database transactions, unique primary‑key constraints for idempotent order creation, and optimistic‑locking version fields to avoid duplicate orders and solve the ABA problem.
ABA problemBackendDatabase Transaction
0 likes · 10 min read

This article explains why locks are essential in programming, categorizes various lock types such as pessimistic, optimistic, spin, fair, reentrant, and distributed locks, and shows how to choose and implement them in Java for high‑concurrency, high‑availability, and high‑performance systems.
Javadistributed-systemsoptimistic locking
0 likes · 12 min read

Google Cloud engineer Jaana Dogan shares 17 hard‑earned database lessons—from ACID nuances and isolation levels to optimistic locking, sharding strategies, AUTOINCREMENT pitfalls, clock drift, and online migrations—providing a practical guide to help developers avoid common pitfalls and design more reliable data systems.
ACIDShardingoptimistic locking
0 likes · 27 min read

The article explains the concepts, advantages, disadvantages, and practical selection criteria of optimistic and pessimistic locking in concurrent systems, illustrating the ideas with version‑control examples and offering implementation tips for both database and web applications.
concurrency controldatabaseoptimistic locking
0 likes · 10 min read

This article explains how to fix red‑packet over‑issuance bugs using optimistic locking with CAS, introduces version fields to prevent ABA problems, shows DAO, service and controller code updates, and demonstrates time‑based and count‑based retry strategies to improve success rates under high concurrency.
BackendCASConcurrency
0 likes · 14 min read

This article explains how to avoid data races in high‑traffic distributed systems by comparing pessimistic and optimistic concurrency control, demonstrating RDBMS row locks and a Redis‑based distributed lock implementation with Python code examples.
Distributed LockPythonRDBMS
0 likes · 16 min read


ITPUBMay 22, 2016 · Databases
Optimistic locking replaces heavyweight pessimistic locks with a version‑based approach, allowing concurrent reads and only checking a version or timestamp during updates, which reduces lock contention, improves performance under high concurrency, but requires careful handling of external updates to avoid dirty data.
Database PerformanceVersioningconcurrency control
0 likes · 5 min read


21CTOApr 8, 2016 · Backend Development
This article explores the complete design of a flash‑sale (秒杀) system, covering business flow, technical bottlenecks, architectural principles, frontend, site and service layer designs, database sharding, caching, overload protection, anti‑cheating measures, and data‑safety strategies for handling massive concurrent traffic.
Cachingdistributed systemsflash sale
0 likes · 34 min read
