Tagged articles
Unique ID
26 articles · Page 1 of 1
This article walks through the challenges of a growing order system, analyzes current bottlenecks, compares sharding and distributed database products, proposes a unique ID strategy, outlines sharding key selection, presents a migration plan with ShardingSphere‑JDBC, and discusses risks and FAQs for a robust backend architecture.
ShardingUnique IDdatabase scaling
0 likes · 18 min read

This article explains how using globally unique identifiers for each test case prevents data collisions, enables parallel execution, simplifies cleanup, and improves stability in Python automated testing frameworks such as pytest, while also highlighting common pitfalls and best‑practice recommendations.
Test AutomationUnique IDdata isolation
0 likes · 7 min read

Generating unique IDs may seem trivial, but common approaches like combining Date.now() with Math.random() or using a simple counter suffer from timestamp precision limits and non‑cryptographic randomness, whereas the modern, standards‑based crypto.randomUUID() provides collision‑free, cryptographically secure identifiers across browsers and Node.js.
JavaScriptSecurityUnique ID
0 likes · 4 min read

This article explains common pitfalls of generating unique IDs with timestamps and Math.random(), shows why naive counters are unreliable in browsers, and demonstrates the robust, standards‑based solution using the built‑in crypto.randomUUID() method, which offers cryptographic security and near‑zero collision risk.
JavaScriptUnique IDcrypto
0 likes · 5 min read

This article explains the importance of globally unique identifiers in distributed systems, outlines their key characteristics such as global uniqueness, monotonic increase, and security, and compares five implementation approaches—UUID, database auto‑increment, Redis, Zookeeper, and Snowflake—detailing their advantages and drawbacks.
Unique IDuuid
0 likes · 8 min read

This article explains the Snowflake ID algorithm, its 64‑bit structure, provides a complete Java implementation, discusses common issues such as clock rollback and node ID management, and compares Snowflake IDs with UUIDs while suggesting Baidu's UidGenerator as a robust improvement.
JavaSnowflakeUnique ID
0 likes · 9 min read

This article explains the concept of distributed global unique identifiers, outlines four essential characteristics of such IDs, and provides a detailed comparison of five generation schemes—UUID, database‑generated IDs, Redis, Zookeeper, and Snowflake—highlighting their advantages, drawbacks, and suitable use cases.
SnowflakeUnique IDredis
0 likes · 8 min read

This article examines NanoID as a modern alternative to UUID, detailing its smaller size, higher speed, stronger security, language support, custom alphabets, lack of dependencies, and compatibility, while also discussing its limitations and future prospects for unique identifier generation in JavaScript projects.
JavaScriptUnique IDnanoid
0 likes · 7 min read

The article discusses how to give each class object a unique identifier, compares inheritance and composition for associating objects, and examines the trade‑offs of each approach using C++ examples, ultimately suggesting that the choice should depend on hierarchy depth and maintenance cost.
C++CompositionInheritance
0 likes · 5 min read

The article explains why idempotency is essential for reliable services, describes how unique identifiers such as UUIDs and Snowflake-generated IDs can guarantee idempotent operations, and outlines practical storage and query techniques using databases or Redis to prevent duplicate orders, inventory deductions, and payments.
IdempotencySnowflakeUnique ID
0 likes · 6 min read

This article explains Twitter's Snowflake distributed ID algorithm, its 64‑bit structure, advantages and drawbacks, and compares it with Baidu's UIDGenerator and Meituan's Leaf‑Snowflake implementations, helping readers choose the most suitable unique‑ID solution for their backend systems.
BackendSnowflakeUnique ID
0 likes · 5 min read

This article explains Twitter's Snowflake algorithm, detailing its 64‑bit structure, the role of each bit segment, a step‑by‑step Java implementation, and the algorithm's performance advantages and practical limitations in distributed backend systems.
AlgorithmBackendJava
0 likes · 10 min read

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.
ConcurrencyJavaUnique ID
0 likes · 11 min read

Idempotency ensures that repeated service calls produce the same result, which can be achieved by using unique identifiers such as UUIDs or Snowflake-generated IDs, employing shared storage like MySQL or Redis, and optimizing queries to avoid unnecessary overhead in distributed backend systems.
IdempotencyUnique IDdistributed-systems
0 likes · 6 min read

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.
JavaUnique IDdistributed systems
0 likes · 13 min read

The article explains why idempotency is essential for reliable services, describes how unique identifiers such as UUIDs, Snowflake IDs, and database‑generated keys can be used to achieve it, and offers practical guidance on shared storage, avoiding unnecessary queries, and handling duplicate requests in distributed systems.
IdempotencySnowflakeUnique ID
0 likes · 8 min read

This article reviews common system‑wide unique ID generation techniques—including database auto‑increment, UUIDs, Redis counters, Twitter's Snowflake, Zookeeper sequences, and MongoDB ObjectId—detailing their advantages, drawbacks, optimization tips, and providing C# code examples for implementation.
Unique IDcsharpdistributed-systems
0 likes · 15 min read

The article explains why idempotency is essential for reliable service calls, discusses using unique identifiers such as UUIDs and Snowflake algorithms, compares centralized and client‑side ID generation, and offers practical storage and query‑optimisation techniques to prevent duplicate orders and resource waste.
IdempotencySnowflakeUnique ID
0 likes · 6 min read


21CTOFeb 20, 2020 · Backend Development
Generating globally unique IDs in distributed systems requires balancing uniqueness, monotonicity, high availability, security, and storage efficiency, and this article compares common solutions—including database auto‑increment, Redis/MongoDB/Zookeeper, UUID versions, and the Snowflake algorithm—detailing their advantages, drawbacks, and practical implementation tips.
BackendSnowflakeUnique ID
0 likes · 9 min read

This article explains the need for compact, time‑ordered unique IDs in distributed systems, describes Twitter's Snowflake 64‑bit ID structure, provides a full Java implementation with bit‑allocation details, and demonstrates its high‑performance generation of millions of IDs.
BackendJavaSnowflake
0 likes · 6 min read


21CTODec 6, 2017 · Backend Development
This article explains Ctrip's design of a globally unique, high‑concurrency user ID generator for sharded MySQL databases, reviews common industry solutions, and details the final optimized approach that combines a MySQL auto‑increment table with in‑memory segment allocation to achieve millisecond‑level response times.
High ConcurrencyJavaMySQL
0 likes · 8 min read

This article describes the background, requirements, existing industry solutions, and the final optimized implementation of a high‑performance, globally unique user ID generator based on MySQL auto‑increment, Redis, and atomic memory segments, including performance results from production deployment.
BackendSnowflakeUnique ID
0 likes · 8 min read

This article describes Ctrip's design of a distributed, globally unique user ID generator for MySQL migration, covering requirements, evaluation of common approaches such as auto‑increment, UUID, Snowflake and Redis, and detailing the final Flicker‑based solution with segment caching using AtomicLong to achieve high concurrency and reliability.
BackendUnique IDdistributed-systems
0 likes · 9 min read


21CTOOct 15, 2017 · Backend Development
This article surveys various distributed unique ID generation techniques—including Oracle auto‑increment, Redis batch allocation, UUID versions, Hibernate and MongoDB strategies, and Twitter’s Snowflake—explaining their structures, trade‑offs, and practical implementation considerations for reliable, collision‑free identifiers.
SnowflakeUnique IDbackend-development
0 likes · 10 min read


ITPUBFeb 10, 2017 · Backend Development
This article explains the challenges of generating globally unique IDs across distributed shards, outlines the requirements for such IDs, and details Twitter's Snowflake algorithm—including its structure, generation process, and clock handling—before exploring three notable Snowflake variants and their trade‑offs.
BackendSnowflakeUnique ID
0 likes · 10 min read

This article details Dazhong Dianping's practical approach to sharding its massive order database, covering vertical and horizontal partitioning strategies, specific sharding algorithms, unique ID design, data migration phases, and lessons learned for long‑term scalability.
Horizontal ScalingShardingUnique ID
0 likes · 12 min read
