Tagged articles
ABA problem
17 articles · Page 1 of 1
This article explains the classic ABA issue in Java's Compare‑And‑Swap (CAS) operations, outlines why long spin loops and single‑variable limitations can degrade performance, and presents practical solutions such as AtomicStampedReference, LockSupport, ReentrantLock, and optimized data structures to mitigate these challenges.
ABA problemCASJava Concurrency
0 likes · 4 min read

This article explains the ABA concurrency issue in distributed systems and presents three practical solutions—using Redis locks, implementing optimistic locking with version fields, and leveraging ordered message queues—to ensure data consistency under concurrent updates.
ABA problemConcurrencyOptimistic Lock
0 likes · 5 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 a version‑column strategy to prevent duplicate submissions and resolve the ABA anomaly in distributed systems.
ABA problemBackendIdempotency
0 likes · 12 min read

This article examines typical high‑concurrency scenarios such as payment processing, online ordering, and cross‑bank transfers, introduces the Compare‑and‑Swap (CAS) approach to ensure strong consistency, explains the ABA problem it can cause, and presents application‑level and data‑layer strategies—including versioning and SQL examples—to mitigate it.
ABA problemCASVersioning
0 likes · 9 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 update by using unique order IDs, database primary‑key constraints, Redis flags, and a version‑column mechanism to detect and prevent duplicate submissions and ABA anomalies in distributed systems.
ABA problemBackendIdempotency
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 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

The article explains how to achieve idempotent order creation and update operations by using unique request identifiers, database primary‑key constraints, Redis flags, and version columns to prevent duplicate submissions and resolve ABA anomalies in distributed backend systems.
ABA problemBackendIdempotency
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 article explains the fundamentals of Compare‑And‑Swap (CAS), its implementation in Java through the Unsafe class, demonstrates AtomicInteger's lock‑free operations, and discusses CAS drawbacks such as spin‑wait overhead, single‑variable limitation, and the ABA problem with mitigation strategies.
ABA problemCASUnsafe
0 likes · 15 min read

This article explains the fundamentals of the compare‑and‑swap (CAS) atomic primitive, how CPUs guarantee its atomicity through bus and cache locking, illustrates a Java spin‑lock implementation using CAS, and discusses typical issues such as single‑variable limitation, long spin times, and the ABA problem with mitigation strategies.
ABA problemCASConcurrency
0 likes · 9 min read


21CTOJan 12, 2021 · Fundamentals
This article explains the fundamentals of lock‑free queues, covering CAS and other atomic operations, detailed enqueue and dequeue implementations, the ABA problem and its solutions, as well as array‑based lock‑free queue designs, providing code examples and practical insights.
ABA problemCASatomic-operations
0 likes · 15 min read

This article explains the ABA issue that can occur in Java's compare‑and‑swap (CAS) operations, illustrates it with a building‑block analogy and concrete code examples, and shows how versioned atomic references such as AtomicStampedReference can reliably prevent the problem.
ABA problemAtomicReferenceCAS
0 likes · 11 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 the ABA issue inherent in Java's CAS operations, demonstrates it with AtomicInteger examples, and shows how AtomicStampedReference (and AtomicMarkableReference) use version stamps to prevent erroneous multiple updates in multithreaded environments.
ABA problemBackendCAS
0 likes · 8 min read
