Tagged articles

optimistic-lock

118 articles · Page 1 of 2
Lobster Programming
Lobster Programming
Jul 13, 2026 · Backend Development

Three‑layer mechanism to ensure a single charge for repeated payment attempts

The article explains a three‑layer strategy—pre‑intercept via Redis locks or temporary tokens, mid‑process control using order status and optimistic locking, and post‑fallback with delayed MQ messages and nightly reconciliation—to guarantee that multiple user clicks result in only one successful payment.

MQdistributed lockoptimistic-lock
0 likes · 7 min read
Three‑layer mechanism to ensure a single charge for repeated payment attempts
Tinker Programmer
Tinker Programmer
Jul 3, 2026 · Backend Development

How Aggregate Roots Guard Business Invariants – The Final Defense Line

The article examines a payroll bug caused by exposing internal collections, then explains three immutable‑focused rules for aggregate roots—expose only through the root, keep each transaction to a single aggregate, and reference other aggregates by ID only—showing how proper design prevents consistency errors, performance loss, and concurrency conflicts in Spring Boot applications.

Aggregate rootDomain EventsDomain-Driven Design
0 likes · 17 min read
How Aggregate Roots Guard Business Invariants – The Final Defense Line
Java Architect Handbook
Java Architect Handbook
Jun 30, 2026 · Backend Development

12 MyBatis‑Plus Tricks That Instantly Boost Development Efficiency

This article presents twelve practical MyBatis‑Plus techniques—including avoiding isNull checks, selecting specific fields, batch operations, EXISTS subqueries, safe ordering, LambdaQuery type safety, between clauses, index‑aware sorting, pagination limits, null‑handling, performance tracking, enum mapping, logical deletion, optimistic locking, and increment/decrement methods—to help developers write cleaner, faster, and more maintainable Java code.

Batch OperationsLambdaQueryWrapperORM
0 likes · 18 min read
12 MyBatis‑Plus Tricks That Instantly Boost Development Efficiency
Coder Life Journal
Coder Life Journal
Jun 28, 2026 · Backend Development

Idempotency vs Duplicate Orders: 5 Reliable Solutions After a Double‑Charge Mishap

The article explains that idempotency prevents the same operation from being executed twice, illustrates a real double‑charge bug, evaluates five concrete approaches—including Redis check‑then‑set, DB unique index, optimistic lock, Redis distributed lock, and a message deduplication table—details their failure conditions and suitable scenarios, and recommends combining Redis lock with a database unique index for the most robust protection.

DatabaseIdempotencyRedis
0 likes · 10 min read
Idempotency vs Duplicate Orders: 5 Reliable Solutions After a Double‑Charge Mishap
Cloud Architecture
Cloud Architecture
Jun 24, 2026 · Backend Development

Four Levels of Concurrency Control: Optimistic Locks to Message Queues for Million‑QPS

High‑concurrency systems must go beyond simple locking; the article breaks down four progressive strategies—optimistic locking, database pessimistic locking, Redis distributed locks, and finally message‑queue serialization—explaining their trade‑offs, implementation details, pitfalls, and how to combine them into a layered architecture that sustains million‑QPS workloads with consistency, throughput, and recoverability.

Concurrency ControlHigh QPSMessage Queue
0 likes · 32 min read
Four Levels of Concurrency Control: Optimistic Locks to Message Queues for Million‑QPS
Java Architect Handbook
Java Architect Handbook
May 26, 2026 · Backend Development

How to Prevent Duplicate Consumption in RabbitMQ? 5 Practical Solutions for Interviews

The article explains why RabbitMQ may deliver the same message multiple times, emphasizes that business‑level idempotency is required, and compares five concrete deduplication approaches—unique message ID with a dedup table, database unique constraints, Redis SETNX, optimistic locking, and state‑machine design—detailing their implementation, suitable scenarios, and trade‑offs.

IdempotencyRedis SETNXdeduplication
0 likes · 13 min read
How to Prevent Duplicate Consumption in RabbitMQ? 5 Practical Solutions for Interviews
Java Tech Workshop
Java Tech Workshop
May 25, 2026 · Backend Development

Ensuring SpringBoot Message Idempotency to Prevent Duplicate Consumption

The article analyzes why duplicate consumption is inevitable in MQ systems, defines message idempotency, and presents four practical solutions—including Redis SETNX, database unique indexes, state‑machine with optimistic locking, and global unique constraints—along with their pros, cons, and best‑practice guidelines for SpringBoot applications.

DatabaseMQMessage Idempotency
0 likes · 13 min read
Ensuring SpringBoot Message Idempotency to Prevent Duplicate Consumption
Linyb Geek Road
Linyb Geek Road
May 14, 2026 · Backend Development

How to Build a Reliable 15‑Minute Order Auto‑Cancel in Java: From Naïve @Scheduled to Production‑Ready Redisson

The article walks through the pitfalls of a seemingly simple 15‑minute unpaid‑order cancellation requirement, evaluates five implementation options—from a basic @Scheduled poll to Redis ZSet, DelayQueue, and distributed Redisson solutions—culminating in a production‑grade Redisson scheduler with optimistic‑lock safeguards and detailed best‑practice guidelines.

RedisRedissonScheduled Tasks
0 likes · 13 min read
How to Build a Reliable 15‑Minute Order Auto‑Cancel in Java: From Naïve @Scheduled to Production‑Ready Redisson
Architect-Kip
Architect-Kip
Apr 29, 2026 · Backend Development

A Generic State Machine Solution for Managing Business Entity Lifecycles

This article presents a comprehensive state‑machine‑based approach for managing the lifecycle of business entities such as orders and work orders, detailing core pain points, essential questions a state machine must answer, a comparative analysis of four implementation options, and a recommended solution that combines a database transition table, domain services, and optimistic‑lock concurrency control, along with architecture diagrams, code snippets, and operational guidelines.

Domain ServiceLifecycle Managementaudit log
0 likes · 15 min read
A Generic State Machine Solution for Managing Business Entity Lifecycles
IT Services Circle
IT Services Circle
Apr 29, 2026 · Backend Development

10 Common MyBatis-Plus Pitfalls and How to Avoid Them

This article analyzes ten frequent pitfalls when using MyBatis-Plus—such as incorrect pagination totals, pagination plugin misconfiguration, logical delete failures, auto‑fill issues, optimistic‑lock mismatches, null handling in QueryWrapper, batch‑insert performance, enum mapping errors, wrapper condition overrides, and type‑handler problems—provides root‑cause explanations, concrete code examples, and practical solutions to help developers write more robust and efficient Java backend code.

Batch InsertEnum MappingLogical Delete
0 likes · 19 min read
10 Common MyBatis-Plus Pitfalls and How to Avoid Them
Java Backend Technology
Java Backend Technology
Apr 28, 2026 · Backend Development

10 Common MyBatis-Plus Pitfalls and How to Avoid Them

This article examines ten frequent pitfalls when using MyBatis-Plus—such as incorrect pagination counts, disabled pagination, logical‑delete mishandling, auto‑fill failures, optimistic‑lock issues, batch‑insert slowness, enum mapping errors, JSON type‑handler problems, and query‑wrapper quirks—explains their causes, and provides concrete code‑level solutions and best‑practice recommendations.

Batch InsertEnum MappingJSON TypeHandler
0 likes · 18 min read
10 Common MyBatis-Plus Pitfalls and How to Avoid Them
Su San Talks Tech
Su San Talks Tech
Apr 27, 2026 · Backend Development

10 Common Pitfalls in MyBatis-Plus and How to Avoid Them

The article enumerates ten typical traps when using MyBatis-Plus—such as incorrect pagination counts, ineffective pagination plugins, logical delete mishandling, auto‑fill failures, optimistic‑lock issues, null‑value conditions, batch‑insert slowness, enum mapping errors, wrapper overwrites, and type‑handler problems—explains why they occur, and provides concrete code‑level solutions and best‑practice recommendations.

Batch InsertEnum MappingLogical Delete
0 likes · 19 min read
10 Common Pitfalls in MyBatis-Plus and How to Avoid Them
LuTiao Programming
LuTiao Programming
Apr 18, 2026 · Backend Development

Beyond @Transactional: Build a Java Ticket System, Master Deadlocks & Isolation Levels

The article shows why a simple @Transactional approach fails under 300,000 concurrent users, explains MVCC behavior, demonstrates how to use row‑level pessimistic locks, sorting, FOR NO KEY UPDATE, short transactions, optimistic locking, and proper isolation levels, and outlines a production‑ready architecture with read/write splitting, Redis rate limiting and connection‑pool tuning.

DeadlockIsolation LevelSpring Boot
0 likes · 10 min read
Beyond @Transactional: Build a Java Ticket System, Master Deadlocks & Isolation Levels
Coder Trainee
Coder Trainee
Apr 14, 2026 · Operations

5 Production Nightmares in an Education Mini‑Program and How to Avoid Them

The author recounts five critical production incidents that crippleed an education mini‑program—Redis connection‑pool exhaustion, duplicate bookings, double refunds, mis‑firing no‑show jobs, and inventory oversell—detailing root causes, concrete fixes, and hard‑won lessons for building resilient backend services.

IdempotencyMonitoringMySQL
0 likes · 10 min read
5 Production Nightmares in an Education Mini‑Program and How to Avoid Them
LuTiao Programming
LuTiao Programming
Feb 1, 2026 · Backend Development

Why Ticket Sales Fail: A Deep Dive into Concurrency, Locks, and Building a Reliable Ticket‑Booking System

When half a million users simultaneously try to buy 5,000 concert tickets, naive ordering logic leads to race conditions and double bookings, so the article walks through the root causes, compares pessimistic, optimistic, and Redis distributed locks, and presents an industrial‑grade microservice design with a three‑stage state machine to ensure strong consistency and high availability.

Redisconcurrencydistributed lock
0 likes · 8 min read
Why Ticket Sales Fail: A Deep Dive into Concurrency, Locks, and Building a Reliable Ticket‑Booking System
IT Services Circle
IT Services Circle
Jan 20, 2026 · Backend Development

How to Achieve Near‑Perfect Cache Consistency: Double‑Check, Queues, and Advanced Strategies

This article walks through the fundamentals and advanced techniques for guaranteeing cache consistency, covering the Double‑Check pattern, root causes of inconsistency, interview‑ready questions, practical solutions like message queues, optimistic locking, multi‑level caching, and cutting‑edge schemes such as consistent hashing with singleflight.

Cache ConsistencyMulti-Level Cacheconsistent hashing
0 likes · 20 min read
How to Achieve Near‑Perfect Cache Consistency: Double‑Check, Queues, and Advanced Strategies
ITFLY8 Architecture Home
ITFLY8 Architecture Home
Jan 14, 2026 · Backend Development

How to Handle Hot Account Deduction in High‑Concurrency Systems

This article examines strategies for low‑latency, consistent hot‑account updates under high concurrency, comparing optimistic DB locking, Redis‑based deduction with asynchronous merging, data sharding, and MQ‑driven batch processing, and also addresses read‑side solutions.

Redisasynchronous processinghigh concurrency
0 likes · 5 min read
How to Handle Hot Account Deduction in High‑Concurrency Systems
Coder Trainee
Coder Trainee
Jan 11, 2026 · Backend Development

Ensuring API Idempotency: Primary Keys, Optimistic Locks, and Token Strategies

The article explains three practical methods for achieving API idempotency—leveraging unique database primary keys (with distributed IDs), applying optimistic locking via version fields, and using a global anti‑repeat token stored in Redis—detailing their applicability, requirements, and operational flow.

API idempotencyRedis tokendistributed ID
0 likes · 3 min read
Ensuring API Idempotency: Primary Keys, Optimistic Locks, and Token Strategies
SpringMeng
SpringMeng
Nov 19, 2025 · Backend Development

Building a High‑Performance Seckill System with SpringBoot, RabbitMQ and Redis (Full Code)

This article walks through the design and implementation of a complete seckill (flash‑sale) system built on SpringBoot, MyBatis, MySQL, RabbitMQ and Redis, covering double MD5 password hashing, distributed sessions, unified exception handling, caching strategies, memory flags, pre‑decrement inventory, asynchronous order processing, oversell prevention, and rate limiting, with code snippets and UI screenshots.

Distributed SessionRedisSeckill
0 likes · 9 min read
Building a High‑Performance Seckill System with SpringBoot, RabbitMQ and Redis (Full Code)
Ray's Galactic Tech
Ray's Galactic Tech
Oct 20, 2025 · Backend Development

Pessimistic, Optimistic & Distributed Locks: Core Concepts, Scenarios & Tips

This article explains the fundamental ideas behind pessimistic, optimistic, and distributed locking, compares their strengths and weaknesses, outlines typical application scenarios such as inventory deduction, banking transfers, and cache protection, and provides concrete implementation examples using SQL row locks, version fields, CAS, Redis WATCH, and Lua scripts.

Redisconcurrencylocking
0 likes · 8 min read
Pessimistic, Optimistic & Distributed Locks: Core Concepts, Scenarios & Tips
Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
Sep 24, 2025 · Databases

Unlock MySQL Performance: How Optimistic Locking Works

This article explains MySQL's optimistic locking strategy, detailing how a version column enables conflict detection during updates, provides step‑by‑step SQL examples, compares it with pessimistic locking, and shows why it improves performance in read‑heavy, low‑conflict environments.

Concurrency ControlDatabaseMySQL
0 likes · 3 min read
Unlock MySQL Performance: How Optimistic Locking Works
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Sep 23, 2025 · Backend Development

Spring Boot 3 Concurrency: Locks, Optimistic & Pessimistic Updates

This article explains common problems of concurrent database updates in Spring Boot 3 and demonstrates five practical solutions—including database locks, optimistic and pessimistic locking, transaction isolation levels, and application‑level locks—accompanied by complete code examples and test results.

Spring BootTransaction Managementconcurrency
0 likes · 10 min read
Spring Boot 3 Concurrency: Locks, Optimistic & Pessimistic Updates
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Sep 4, 2025 · Backend Development

How to Prevent and Handle Database Deadlocks in Spring Boot 3

Learn how Spring Boot 3 handles database deadlocks by exploring transaction isolation levels, optimistic and pessimistic locking, and practical code examples that show prevention, detection, and retry strategies to keep your applications reliable under high concurrency.

Database DeadlockTransaction Isolationoptimistic-lock
0 likes · 12 min read
How to Prevent and Handle Database Deadlocks in Spring Boot 3
Lobster Programming
Lobster Programming
May 30, 2025 · Backend Development

How to Ensure API Idempotency with Locks: 5 Proven Strategies

This article explores five practical lock-based approaches—including database primary keys, pessimistic and optimistic locks, state machines, and distributed locks—to achieve reliable API idempotency in distributed systems, highlighting implementation details, trade‑offs, and code examples.

API idempotencydatabase lockdistributed lock
0 likes · 7 min read
How to Ensure API Idempotency with Locks: 5 Proven Strategies
Java Backend Technology
Java Backend Technology
May 7, 2025 · Backend Development

When Can Flawed Code Stay Unchanged? A Deep Dive into Concurrency and Locking

The article examines a seemingly harmless Java update snippet that hides a concurrency race condition, discusses why a team might decide not to change it in low‑frequency scenarios, and then presents safer alternatives such as selective updates, optimistic and pessimistic locks, and strict guidelines for financial‑critical code.

Code Reviewoptimistic-lockpessimistic lock
0 likes · 11 min read
When Can Flawed Code Stay Unchanged? A Deep Dive into Concurrency and Locking
Java Tech Enthusiast
Java Tech Enthusiast
Apr 19, 2025 · Backend Development

Preventing Product Overselling in High‑Concurrency E‑Commerce Systems

To prevent overselling during flash sales, the article explains how non‑atomic database updates cause negative stock and presents solutions such as optimistic DB locking, Redis Lua atomic deductions, Redisson distributed locks, transactional message queues, and pre‑deduction with rate limiting, recommending a combined approach that achieved 120 000 QPS with zero oversell.

distributed lockinventory managementoptimistic-lock
0 likes · 7 min read
Preventing Product Overselling in High‑Concurrency E‑Commerce Systems
Su San Talks Tech
Su San Talks Tech
Mar 14, 2025 · Backend Development

Ensuring Idempotency in Distributed Systems: Patterns, Code, and Best Practices

This article explains the concept of idempotency, outlines scenarios where it is essential, analyzes common causes of idempotency problems, and presents a comprehensive set of solutions—including unique constraints, optimistic and pessimistic locks, distributed locks, token mechanisms, state machines, deduplication tables, and global request IDs—accompanied by practical code examples and database design guidelines.

Idempotencybackenddistributed systems
0 likes · 14 min read
Ensuring Idempotency in Distributed Systems: Patterns, Code, and Best Practices
Su San Talks Tech
Su San Talks Tech
Oct 5, 2024 · Backend Development

Mastering Idempotency: Design Patterns and Code Solutions for Reliable APIs

Idempotency ensures that repeated API calls produce the same result without side effects, and this guide explains its principles, common scenarios like payments and messaging, root causes of idempotency failures, and multiple implementation strategies—including unique constraints, optimistic and pessimistic locks, distributed locks, token mechanisms, state machines, and deduplication tables—with practical code examples.

API DesignIdempotencybackend
0 likes · 14 min read
Mastering Idempotency: Design Patterns and Code Solutions for Reliable APIs
Bilibili Tech
Bilibili Tech
Sep 27, 2024 · Backend Development

Concurrency Issues and Race Condition Mitigation in Bilibili's Content Production System

Bilibili tackled race‑condition vulnerabilities in its massive video content pipeline by replacing simple timestamp checks with optimistic locking (CAS) and rate‑limiting locks, adding version verification and observation tools that now eliminate missed reviews and improve security, scalability, and real‑time editing reliability.

Bilibiliconcurrencycontent moderation
0 likes · 10 min read
Concurrency Issues and Race Condition Mitigation in Bilibili's Content Production System
Su San Talks Tech
Su San Talks Tech
Aug 11, 2024 · Backend Development

Mastering Idempotency: Design Patterns and Code Examples for Reliable APIs

This article explains the concept of idempotency, outlines scenarios where it is essential, analyzes common causes of idempotency issues, and presents multiple practical solutions—including unique constraints, optimistic and pessimistic locks, distributed locks, token mechanisms, state machines, deduplication tables, and global request IDs—accompanied by concrete code examples.

Idempotencydistributed systemsoptimistic-lock
0 likes · 14 min read
Mastering Idempotency: Design Patterns and Code Examples for Reliable APIs
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Apr 17, 2024 · Backend Development

Understanding Idempotence and Common Backend Solutions

The article explains the concept of idempotence in computing, illustrates typical duplicate‑request scenarios, and presents three practical backend solutions—unique database indexes, optimistic locking with version control, and a Redis‑based token mechanism—along with their advantages, trade‑offs, and implementation details.

HTTPbackendidempotence
0 likes · 7 min read
Understanding Idempotence and Common Backend Solutions
Java Tech Enthusiast
Java Tech Enthusiast
Apr 6, 2024 · Backend Development

Inventory Deduction and Concurrency Control in Backend Systems

The article outlines the three‑step inventory deduction workflow—select, verify, update—and explains how concurrent requests can cause overselling, then compares mitigation strategies such as pessimistic SELECT FOR UPDATE locks, optimistic CAS version retries, atomic decrement SQL statements, and Redis transactions, highlighting their trade‑offs in consistency and throughput.

Inventoryconcurrencyoptimistic-lock
0 likes · 5 min read
Inventory Deduction and Concurrency Control in Backend Systems
MaGe Linux Operations
MaGe Linux Operations
Feb 13, 2024 · Fundamentals

Understanding Optimistic vs Pessimistic Locks: When and How to Use Them

This article explains the purpose of locks in concurrent environments, compares optimistic (CAS) and pessimistic locking mechanisms, outlines their advantages, disadvantages, suitable scenarios, and provides PHP/PDO code examples demonstrating implementation and performance testing under high concurrency.

Concurrency ControlMySQLPHP
0 likes · 11 min read
Understanding Optimistic vs Pessimistic Locks: When and How to Use Them
Selected Java Interview Questions
Selected Java Interview Questions
Jan 15, 2024 · Backend Development

Preventing Inventory Overselling in High‑Concurrency Scenarios: Java, Redis Distributed Lock, MySQL Row Lock, Optimistic Lock, and SQL Solutions

The article analyzes the inventory oversell problem caused by concurrent purchase requests and presents four backend solutions—including a Redis distributed lock, MySQL row lock, optimistic locking with version fields, and conditional SQL updates—illustrated with Java code and SQL examples to ensure data consistency.

Redisconcurrencydistributed lock
0 likes · 10 min read
Preventing Inventory Overselling in High‑Concurrency Scenarios: Java, Redis Distributed Lock, MySQL Row Lock, Optimistic Lock, and SQL Solutions
IT Niuke
IT Niuke
Dec 25, 2023 · Backend Development

Master MyBatis-Plus: From Basics to Advanced Features

This article introduces MyBatis-Plus, an enhancement layer for MyBatis, and walks through its core features—non‑intrusive CRUD, Lambda queries, primary‑key strategies, automatic field filling, optimistic locking, pagination, logical delete, performance analysis, condition builders, and a code generator—providing complete code examples and configuration steps for Spring Boot integration.

CRUDORMSpring Boot
0 likes · 17 min read
Master MyBatis-Plus: From Basics to Advanced Features
Shepherd Advanced Notes
Shepherd Advanced Notes
Sep 15, 2023 · Backend Development

How to Prevent Duplicate Order Submissions in Flash‑Sale Systems: An Idempotency Guide

The article explains the concept of idempotency, outlines common duplicate‑submission scenarios such as form resubmission, malicious voting, client retries, and message re‑consumption, and details three practical implementation methods—database constraints, token‑based middleware, and state‑machine logic—complete with code examples and trade‑off considerations.

DatabaseIdempotencybackend development
0 likes · 13 min read
How to Prevent Duplicate Order Submissions in Flash‑Sale Systems: An Idempotency Guide
政采云技术
政采云技术
Mar 23, 2023 · Backend Development

Distributed Locks: Concepts, Characteristics, and Common Implementation Strategies

This article explains the need for distributed locks in multi‑node systems, describes their core characteristics, and compares popular implementation approaches such as database‑based optimistic and pessimistic locks, Redis atomic locks, and ZooKeeper sequential node locks, highlighting their principles and trade‑offs.

Redisoptimistic-lockpessimistic lock
0 likes · 8 min read
Distributed Locks: Concepts, Characteristics, and Common Implementation Strategies
Selected Java Interview Questions
Selected Java Interview Questions
Feb 23, 2023 · Backend Development

Understanding Lock Strategies: Optimistic, Pessimistic, Read‑Write, Heavy/Light, Fairness and Reentrancy

This article explains various lock strategies—including optimistic and pessimistic locks, read‑write locks, heavyweight vs. lightweight locks, spin locks, fair vs. unfair locks, and reentrant locks—detailing their definitions, use‑cases, underlying mechanisms, and illustrative examples for concurrent programming in Java and other languages.

javalockingoptimistic-lock
0 likes · 10 min read
Understanding Lock Strategies: Optimistic, Pessimistic, Read‑Write, Heavy/Light, Fairness and Reentrancy
ITPUB
ITPUB
Feb 17, 2023 · Databases

Master MySQL Locking: From Row Locks to Deadlocks and How to Prevent Them

This article explains why MySQL needs locking, details every InnoDB lock type—including shared, exclusive, intention, record, gap, next‑key, insert‑intention and auto‑increment locks—shows how they interact, and provides practical guidance for avoiding deadlocks and safely updating rows.

DeadlockInnoDBIsolation Level
0 likes · 22 min read
Master MySQL Locking: From Row Locks to Deadlocks and How to Prevent Them
IT Services Circle
IT Services Circle
Jun 25, 2022 · Databases

Understanding Optimistic and Pessimistic Locks in MySQL

Optimistic and pessimistic locks are conceptual concurrency control strategies used across databases and caching systems; the article explains their principles, MySQL implementations with SELECT ... FOR UPDATE and version checks, compares their trade‑offs, and advises preferring optimistic locking in high‑concurrency scenarios.

Concurrency ControlMySQLoptimistic-lock
0 likes · 6 min read
Understanding Optimistic and Pessimistic Locks in MySQL
Java Interview Crash Guide
Java Interview Crash Guide
Mar 22, 2022 · Backend Development

Ensuring API Idempotency: Why It Matters and How to Implement It

This article explains the concept of API idempotency, why duplicate requests can cause critical issues such as double payments, and presents a comprehensive set of client‑side and server‑side strategies—including token mechanisms, PRG pattern, unique indexes, optimistic locking, distributed locks, and more—to guarantee safe, repeatable operations.

API idempotencyDuplicate Requestsbackend development
0 likes · 9 min read
Ensuring API Idempotency: Why It Matters and How to Implement It
Top Architect
Top Architect
Feb 26, 2022 · Backend Development

Design and Analysis of a Flash‑Sale System: Architecture, Request Flow, and Lock Strategies

This article analyzes the business scenario of flash‑sale (秒杀) systems, outlines their technical characteristics, dissects the request chain, compares optimistic and pessimistic locking mechanisms with code examples, and presents a comparative table of concurrency‑control outcomes.

Backend ArchitectureConcurrency ControlFlash Sale
0 likes · 8 min read
Design and Analysis of a Flash‑Sale System: Architecture, Request Flow, and Lock Strategies
IT Architects Alliance
IT Architects Alliance
Feb 24, 2022 · Backend Development

Technical Analysis of Flash‑Sale (秒杀) Systems: Scenarios, Architecture, and Lock Strategies

This article examines flash‑sale business scenarios, outlines their high‑concurrency characteristics, dissects the request‑flow architecture from client to database, and compares optimistic, retry‑optimistic, and pessimistic locking techniques with practical examples and performance considerations.

Flash Salehigh concurrencyoptimistic-lock
0 likes · 8 min read
Technical Analysis of Flash‑Sale (秒杀) Systems: Scenarios, Architecture, and Lock Strategies
Architect
Architect
Feb 24, 2022 · Backend Development

Design and Analysis of Flash‑Sale (秒杀) Systems: Scenarios, Technical Characteristics, Request Chain, and Lock Strategies

This article examines flash‑sale systems by outlining typical business scenarios, analyzing read‑heavy and high‑concurrency technical traits, detailing the end‑to‑end request flow, and comparing optimistic, retry‑optimistic, and pessimistic locking mechanisms with practical SQL examples and performance tables.

Backend ArchitectureFlash Saledatabase locking
0 likes · 9 min read
Design and Analysis of Flash‑Sale (秒杀) Systems: Scenarios, Technical Characteristics, Request Chain, and Lock Strategies
Top Architect
Top Architect
Feb 17, 2022 · Backend Development

Understanding API Idempotency and How to Ensure It

This article explains the concept of API idempotency, why duplicate requests occur in distributed systems, and presents a comprehensive set of server‑side and client‑side techniques—including token mechanisms, PRG pattern, unique indexes, optimistic locking, distributed locks, and idempotent state machines—to guarantee that repeated calls produce only a single effect.

APIIdempotencybackend
0 likes · 10 min read
Understanding API Idempotency and How to Ensure It
Java Tech Enthusiast
Java Tech Enthusiast
Nov 18, 2021 · Fundamentals

Pessimistic and Optimistic Locks in Java: Theory and Code Examples

The article compares Java's pessimistic locking mechanisms such as synchronized blocks and ReentrantLock with optimistic approaches like version checks, CAS‑based AtomicInteger and custom spin locks, illustrating each method through counter examples and discussing their performance trade‑offs and limitations.

CASLocksThread Safety
0 likes · 11 min read
Pessimistic and Optimistic Locks in Java: Theory and Code Examples
YunZhu Net Technology Team
YunZhu Net Technology Team
Oct 15, 2021 · Backend Development

Idempotency in Software Systems: Definitions, Real‑World Scenarios, and Implementation Strategies

The article explains the concept of idempotency, illustrates everyday examples of its importance, defines it mathematically and in software, and presents a comprehensive set of practical solutions—including database constraints, frontend controls, locking mechanisms, token‑based forms, message queues, and RPC safeguards—to achieve reliable idempotent behavior in distributed backend systems.

Idempotencyoptimistic-lockpessimistic lock
0 likes · 11 min read
Idempotency in Software Systems: Definitions, Real‑World Scenarios, and Implementation Strategies
Top Architect
Top Architect
Oct 15, 2021 · Backend Development

Design and Challenges of High‑Concurrency Flash‑Sale (Seckill) Systems

The article analyzes flash‑sale business flow, outlines the technical challenges of massive concurrent requests, and presents a comprehensive backend architecture—including request isolation, queueing, caching, sharding, replication, optimistic locking, and overload protection—to ensure correctness, scalability, and availability of seckill services.

Backend ArchitectureSeckillhigh concurrency
0 likes · 34 min read
Design and Challenges of High‑Concurrency Flash‑Sale (Seckill) Systems
Architect
Architect
Sep 30, 2021 · Backend Development

Design and Technical Challenges of High‑Concurrency Flash‑Sale (Seckill) Systems

This article analyses the business flow, unique characteristics, technical challenges, architectural principles, layer‑wise design, database strategies, high‑concurrency issues, cheating defenses, and data‑safety mechanisms required to build a reliable flash‑sale system capable of handling tens of thousands of simultaneous requests.

Backend ArchitectureDatabase DesignFlash Sale
0 likes · 35 min read
Design and Technical Challenges of High‑Concurrency Flash‑Sale (Seckill) Systems
21CTO
21CTO
Aug 8, 2021 · Backend Development

Guaranteeing No Message Loss in RabbitMQ with Persistence and Confirm

This article examines how to ensure reliable message delivery in RabbitMQ by using durable queues, the confirm mechanism, and supplemental strategies such as persisting messages to Redis, implementing idempotent processing with optimistic locking or unique‑ID fingerprints, and employing compensation tasks to achieve near‑zero message loss in high‑concurrency systems.

Confirm MechanismIdempotencyRedis
0 likes · 9 min read
Guaranteeing No Message Loss in RabbitMQ with Persistence and Confirm
ITPUB
ITPUB
Aug 6, 2021 · Backend Development

How to Guarantee RabbitMQ Message Delivery and Achieve Zero Loss

This article examines common pitfalls in RabbitMQ message delivery, explains persistence and confirm mechanisms, and proposes a robust solution combining pre‑storage in Redis, confirm callbacks, scheduled retries, and idempotent processing to ensure virtually zero message loss in high‑concurrency systems.

Confirm MechanismIdempotencyRedis
0 likes · 11 min read
How to Guarantee RabbitMQ Message Delivery and Achieve Zero Loss
Su San Talks Tech
Su San Talks Tech
Jul 27, 2021 · Backend Development

Understanding Java Locks: Optimistic vs Pessimistic, Reentrant, Read‑Write, and More

This article explains the various Java lock mechanisms—including optimistic and pessimistic locks, exclusive and shared locks, reentrant, read‑write, fair/unfair, spin, segment locks, and lock‑escalation techniques—detailing their principles, Java implementations, usage scenarios, and optimization strategies.

Reentrant Lockconcurrencyoptimistic-lock
0 likes · 13 min read
Understanding Java Locks: Optimistic vs Pessimistic, Reentrant, Read‑Write, and More
Laravel Tech Community
Laravel Tech Community
Jul 8, 2021 · Databases

Understanding Optimistic and Pessimistic Locks in MySQL/InnoDB

This article explains the concepts, mechanisms, and practical code examples of optimistic and pessimistic locking in MySQL/InnoDB, including version‑based optimistic locks, shared (read) locks, exclusive (write) locks, and how to apply them with Laravel's query builder.

Database ConcurrencyMySQLlaravel
0 likes · 6 min read
Understanding Optimistic and Pessimistic Locks in MySQL/InnoDB
Selected Java Interview Questions
Selected Java Interview Questions
May 29, 2021 · Databases

Understanding Database Locks: Shared, Exclusive, Mutex, Pessimistic, Optimistic, Row, Table, and Page Locks, and Common Concurrency Issues

This article explains the concepts, usage scenarios, and differences of various database locks—including shared (S) lock, exclusive (X) lock, mutex, pessimistic and optimistic locks—as well as row‑level, table‑level, and page‑level locks, and it discusses common concurrency problems such as lost updates, non‑repeatable reads, dirty reads, and deadlocks.

Concurrency ControlDatabase LocksMySQL
0 likes · 8 min read
Understanding Database Locks: Shared, Exclusive, Mutex, Pessimistic, Optimistic, Row, Table, and Page Locks, and Common Concurrency Issues
Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 20, 2021 · Backend Development

Designing a High‑Concurrency Flash‑Sale (秒杀) System: From Naïve Implementation to Optimized Solutions

This article walks through the design of a flash‑sale system, starting with a simple SpringBoot‑MyBatis implementation, then addressing overselling with pessimistic and optimistic locks, applying rate‑limiting algorithms, time‑window controls, interface hiding, frequency limits, and a suite of production‑grade optimizations such as CDN, Nginx load balancing, Redis caching, message queues, and short‑URL handling.

Flash SaleRedisSpringBoot
0 likes · 14 min read
Designing a High‑Concurrency Flash‑Sale (秒杀) System: From Naïve Implementation to Optimized Solutions
Sohu Tech Products
Sohu Tech Products
May 5, 2021 · Backend Development

Implementing Optimistic Locking in Go with GORM

This article explains how to implement optimistic locking in Go using GORM by adding a version field, writing raw SQL updates, creating a reusable wrapper function with retry logic, and leveraging interfaces and type assertions to handle concurrency safely.

GORMGooptimistic-lock
0 likes · 7 min read
Implementing Optimistic Locking in Go with GORM
Code Ape Tech Column
Code Ape Tech Column
Apr 25, 2021 · Backend Development

Master MyBatis-Plus: From Basics to Advanced CRUD, Pagination, and Code Generation

This comprehensive guide walks you through MyBatis-Plus fundamentals, non‑intrusive features, quick project setup, CRUD operations, automatic field filling, optimistic and logical locking, powerful wrapper queries, pagination, and the built‑in code generator, all illustrated with runnable examples and code snippets.

CRUDLogical DeleteSpring Boot
0 likes · 25 min read
Master MyBatis-Plus: From Basics to Advanced CRUD, Pagination, and Code Generation
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Apr 18, 2021 · Backend Development

Idempotency: Definition, Scenarios, and Implementation Strategies

The article explains the concept of idempotency, distinguishes it from duplicate submissions, outlines typical use cases such as network retries and form resubmissions, and presents various backend solutions—including unique indexes, deduplication tables, pessimistic and optimistic locks, distributed locks, and token‑based approaches—complete with SQL examples.

Idempotencyoptimistic-lockpessimistic lock
0 likes · 11 min read
Idempotency: Definition, Scenarios, and Implementation Strategies
Code Ape Tech Column
Code Ape Tech Column
Jan 7, 2021 · Backend Development

Master MyBatis-Plus with Spring Boot: From Setup to Advanced Features

This guide walks through setting up a MySQL database, configuring a Spring Boot project with MyBatis‑Plus, defining entities and mappers, and demonstrates CRUD operations, pagination, logical and physical deletes, optimistic locking, performance monitoring, and code generation, providing complete code snippets and configuration details.

CRUDLogical DeleteSpring Boot
0 likes · 17 min read
Master MyBatis-Plus with Spring Boot: From Setup to Advanced Features
Programmer DD
Programmer DD
Dec 29, 2020 · Backend Development

Mastering Locks: Optimistic, Pessimistic, and Distributed Strategies for High-Concurrency Systems

This article explains the different lock types—pessimistic, optimistic, and distributed—covers their use cases, compares their advantages and drawbacks, and provides concrete code examples and four practical solutions for handling high‑concurrency deduction scenarios such as inventory or balance reduction.

distributed lockjavaoptimistic-lock
0 likes · 13 min read
Mastering Locks: Optimistic, Pessimistic, and Distributed Strategies for High-Concurrency Systems
ITFLY8 Architecture Home
ITFLY8 Architecture Home
Dec 9, 2020 · Backend Development

Ensuring Idempotency in High‑Concurrency E‑Commerce APIs: Strategies & Code

This article explains the concept of idempotency and presents practical techniques—such as unique indexes, token validation, pessimistic and optimistic locking, distributed locks, and API design—to guarantee that repeated requests in a high‑traffic e‑commerce system produce a single consistent outcome.

Idempotencybackendhigh concurrency
0 likes · 8 min read
Ensuring Idempotency in High‑Concurrency E‑Commerce APIs: Strategies & Code
Senior Brother's Insights
Senior Brother's Insights
Nov 30, 2020 · Backend Development

Ensuring Idempotency in Distributed Systems: Strategies and Code Examples

The article explains why idempotent operations are essential in backend and financial systems, describes the mathematical concept, and presents practical techniques such as unique indexes, token validation, pessimistic and optimistic locking, distributed locks, state‑machine design, and API patterns with concrete SQL examples.

DatabaseIdempotencyoptimistic-lock
0 likes · 8 min read
Ensuring Idempotency in Distributed Systems: Strategies and Code Examples
Top Architect
Top Architect
Nov 8, 2020 · Backend Development

Flash Sale (Seckill) System Architecture, Technical Challenges and Solutions

This article analyzes the business flow of flash‑sale (seckill) systems, identifies ten technical challenges such as high concurrency, bandwidth, stock‑deduction and cheating, and presents architecture principles, design patterns, code examples, and safety mechanisms to build a reliable, scalable backend for flash‑sale scenarios.

Flash Salebackend developmentcaching
0 likes · 34 min read
Flash Sale (Seckill) System Architecture, Technical Challenges and Solutions
Java Captain
Java Captain
Oct 31, 2020 · Backend Development

Flash Sale (Seckill) System Analysis, Technical Challenges, Architecture Design, and High‑Concurrency Solutions

This article examines the end‑to‑end workflow of a flash‑sale system, outlines its unique characteristics and technical challenges, and presents a layered architecture—including frontend, site, service, and database designs—along with concurrency control, anti‑cheating measures, and data‑safety strategies for handling massive traffic.

Flash Salecachinghigh concurrency
0 likes · 34 min read
Flash Sale (Seckill) System Analysis, Technical Challenges, Architecture Design, and High‑Concurrency Solutions
Programmer DD
Programmer DD
Oct 19, 2020 · Backend Development

How to Build a High‑Performance Flash‑Sale System: Architecture, Challenges & Solutions

This article explores the end‑to‑end design of a flash‑sale (秒杀) system, detailing business flow, technical challenges, architectural principles, front‑end and back‑end design, concurrency handling, anti‑cheating measures, data safety, and practical solutions for high‑traffic e‑commerce scenarios.

Database ScalingFlash Salehigh concurrency
0 likes · 36 min read
How to Build a High‑Performance Flash‑Sale System: Architecture, Challenges & Solutions
Java Architect Essentials
Java Architect Essentials
Sep 25, 2020 · Backend Development

Challenges and Solutions for Large‑Scale Concurrency in E‑commerce Flash Sales

The article examines the technical difficulties of handling tens of thousands of requests per second in flash‑sale systems, analyzes root causes such as API design, overload, cheating, and data‑safety issues, and proposes practical backend strategies—including Redis caching, load‑balancing, rate‑limiting, and optimistic locking—to maintain performance and reliability.

Flash SaleLoad Balancingbackend optimization
0 likes · 15 min read
Challenges and Solutions for Large‑Scale Concurrency in E‑commerce Flash Sales
Laravel Tech Community
Laravel Tech Community
May 21, 2020 · Databases

When to Use Optimistic vs. Pessimistic Locks in MySQL (and Redis)

This article explains the concepts, advantages, and drawbacks of MySQL pessimistic and optimistic locks, shows how to implement each with SQL and PHP code, compares their suitability for different traffic patterns, and demonstrates a Redis‑based optimistic lock for high‑concurrency flash‑sale scenarios.

MySQLPHPRedis
0 likes · 10 min read
When to Use Optimistic vs. Pessimistic Locks in MySQL (and Redis)
macrozheng
macrozheng
Mar 25, 2020 · Backend Development

Mastering Token Bucket Rate Limiting and Lock Strategies in Flash Sale Systems

This article explains how to implement token‑bucket rate limiting with Guava's RateLimiter, compare it to leaky‑bucket algorithms, and combine it with optimistic and pessimistic locking techniques to prevent overselling in high‑concurrency flash‑sale applications.

Springjavaoptimistic-lock
0 likes · 15 min read
Mastering Token Bucket Rate Limiting and Lock Strategies in Flash Sale Systems
Senior Brother's Insights
Senior Brother's Insights
Dec 25, 2019 · Backend Development

Ensuring Idempotency in Distributed Systems: Strategies and Best Practices

The article explains why idempotent operations are essential in high‑traffic systems, defines idempotency, and presents a comprehensive set of techniques—including unique indexes, token validation, pessimistic and optimistic locking, distributed locks, select‑plus‑insert patterns, state‑machine design, and API safeguards—to guarantee consistent outcomes even under repeated requests.

DatabaseIdempotencydistributed lock
0 likes · 9 min read
Ensuring Idempotency in Distributed Systems: Strategies and Best Practices
Java High-Performance Architecture
Java High-Performance Architecture
Nov 8, 2019 · Databases

How to Prevent Redis Key Race Conditions: Optimistic Locks, Distributed Locks, Timestamps & Queues

This article explains the Redis concurrent key competition problem, illustrates typical scenarios where multiple clients modify the same key, and presents four practical solutions—optimistic locking with WATCH/EXEC, distributed locks, timestamp ordering, and message‑queue serialization—to ensure data correctness under high concurrency.

Message Queueconcurrencydistributed lock
0 likes · 5 min read
How to Prevent Redis Key Race Conditions: Optimistic Locks, Distributed Locks, Timestamps & Queues
Programmer DD
Programmer DD
Jul 9, 2019 · Backend Development

Master Transaction Locks in Spring Data JPA: Pessimistic vs Optimistic

This tutorial explains how to enable and configure transaction locks—including pessimistic and optimistic modes—in Spring Data JPA repositories, demonstrates the use of @Lock and @QueryHints annotations, and shows how to set lock timeouts to ensure data integrity under high concurrency.

LockModeTypejavaoptimistic-lock
0 likes · 6 min read
Master Transaction Locks in Spring Data JPA: Pessimistic vs Optimistic
dbaplus Community
dbaplus Community
Jun 16, 2019 · Fundamentals

Understanding Thread Safety: From ThreadLocal to Locks and CAS

This article explains why thread safety concerns memory rather than threads, compares stack‑local and heap‑shared data, introduces ThreadLocal for per‑thread isolation, and covers mutual‑exclusion locks, optimistic CAS, and their appropriate use cases in concurrent programming.

CASJava concurrencyLocks
0 likes · 15 min read
Understanding Thread Safety: From ThreadLocal to Locks and CAS
Java Captain
Java Captain
May 19, 2019 · Backend Development

Flash Sale (Seckill) System Design and Technical Challenges

This article analyzes the business flow of flash‑sale (seckill) activities, identifies the high‑concurrency technical challenges, and presents a comprehensive backend architecture—including frontend static page handling, request throttling, service‑layer queuing, database sharding, caching, optimistic locking, and anti‑cheating measures—to ensure reliability, scalability, and data consistency.

Backend ArchitectureFlash Saledatabase sharding
0 likes · 33 min read
Flash Sale (Seckill) System Design and Technical Challenges
Architects' Tech Alliance
Architects' Tech Alliance
Apr 3, 2019 · Databases

Choosing Between Optimistic and Pessimistic Locks in Production Systems

The article explains the concepts, advantages, and drawbacks of optimistic and pessimistic locking, provides real‑world examples such as lost updates and inconsistent reads, and offers practical guidelines and implementation techniques for selecting the appropriate concurrency control strategy in database‑driven applications.

Concurrency ControlDatabaseIsolation
0 likes · 10 min read
Choosing Between Optimistic and Pessimistic Locks in Production Systems
21CTO
21CTO
Feb 15, 2019 · Backend Development

Mastering High‑Concurrency Flash Sales: Preventing System Collapse

This article examines the technical challenges of handling massive concurrent traffic during flash‑sale events, explains why backend APIs become bottlenecks, and presents practical strategies—including request design, overload protection, anti‑abuse measures, and data‑safety techniques such as pessimistic, FIFO, and optimistic locking—to keep web systems stable and performant.

Data SafetyFlash SaleLoad Balancing
0 likes · 16 min read
Mastering High‑Concurrency Flash Sales: Preventing System Collapse
Architect's Tech Stack
Architect's Tech Stack
Dec 22, 2018 · Backend Development

Understanding Idempotency: Concepts, Examples, and Implementation Techniques

This article explains the mathematical and programming concept of idempotency, provides real‑world examples such as duplicate form submissions and payment requests, and details practical techniques—including query/select operations, unique indexes, token mechanisms, pessimistic and optimistic locks, distributed locks, and API design—to ensure idempotent behavior in backend systems.

DatabaseIdempotencydistributed systems
0 likes · 9 min read
Understanding Idempotency: Concepts, Examples, and Implementation Techniques
Java Captain
Java Captain
Sep 25, 2018 · Fundamentals

Optimistic vs Pessimistic Locks and CAS Implementation in Java

The article explains the concepts of pessimistic and optimistic locking, details how CAS (Compare‑And‑Swap) implements optimistic locks in Java, discusses their advantages, drawbacks such as the ABA problem and high spin costs, and compares CAS usage with synchronized blocks in concurrent programming.

CASJava concurrencyatomic
0 likes · 14 min read
Optimistic vs Pessimistic Locks and CAS Implementation in Java