Tagged articles
5 articles
Page 1 of 1
Programmer DD
Programmer DD
Sep 25, 2020 · Backend Development

How to Eliminate Duplicate Order Numbers in High‑Concurrency Java Systems

This article analyzes a real‑world incident where duplicate order IDs appeared under high concurrency, critiques the original Java implementation, demonstrates a concurrency test that exposed the flaw, and presents a revised, thread‑safe solution using AtomicInteger, Java 8 date‑time APIs, and IP‑based suffixes to guarantee uniqueness across multiple instances.

DistributedJavaUnique ID
0 likes · 11 min read
How to Eliminate Duplicate Order Numbers in High‑Concurrency Java Systems
Java Backend Technology
Java Backend Technology
Sep 10, 2020 · Backend Development

How to Prevent Duplicate Order Numbers in High-Concurrency Java Applications

This article analyzes a real incident where duplicate order numbers were generated under high concurrency, critiques the original timestamp‑based approach, and presents a thread‑safe Java solution using AtomicInteger, Java 8 date formatting, and optional IP suffixes to ensure globally unique identifiers.

AtomicIntegerDistributed Systemsorder-number
0 likes · 9 min read
How to Prevent Duplicate Order Numbers in High-Concurrency Java Applications
Java Backend Technology
Java Backend Technology
Aug 30, 2020 · Backend Development

How to Generate Collision‑Free Order Numbers in High‑Concurrency Java Apps

The article examines a real‑world incident where duplicate order IDs appeared under high concurrency, analyzes the shortcomings of the original timestamp‑and‑random‑based scheme, and presents a revised Java implementation using thread‑safe counters, Java 8 date‑time APIs, and IP‑based suffixes to reliably produce unique order numbers even in clustered environments.

Distributed SystemsJavaUnique ID
0 likes · 13 min read
How to Generate Collision‑Free Order Numbers in High‑Concurrency Java Apps
FunTester
FunTester
Dec 7, 2019 · Backend Development

Generating Unique Order Numbers in Java: Risks, Testing, and Improved Approaches

The article examines a Java method that creates unique transaction order numbers by combining a timestamp with a four‑digit random code, discusses its collision risk, evaluates testing strategies—including stress testing and UUID replacement—and provides sample code for both generation and duplicate detection.

Javaorder-numberunique identifier
0 likes · 6 min read
Generating Unique Order Numbers in Java: Risks, Testing, and Improved Approaches