Tagged articles
105 articles
Page 1 of 2
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.

audit logconcurrencydomain service
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
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.

IdempotencySpring Bootdistributed-lock
0 likes · 10 min read
5 Production Nightmares in an Education Mini‑Program and How to Avoid Them
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.

asynchronous processinghigh concurrencyoptimistic lock
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 SessionRabbitMQSeckill
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.

concurrencylockingoptimistic lock
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 ControlVersioningdatabase
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 Bootconcurrencyoptimistic lock
0 likes · 10 min read
Spring Boot 3 Concurrency: Locks, Optimistic & Pessimistic Updates
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.

BackendDistributed SystemsIdempotency
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.

BackendDistributed SystemsIdempotency
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.

Distributed SystemsIdempotencyToken
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.

BackendHTTPIdempotence
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.

concurrencyinventoryoptimistic 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 ControlPHPmysql
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.

concurrencydistributed-lockjava
0 likes · 10 min read
Preventing Inventory Overselling in High‑Concurrency Scenarios: Java, Redis Distributed Lock, MySQL Row Lock, Optimistic Lock, and SQL Solutions
政采云技术
政采云技术
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.

optimistic lockpessimistic-lockredis
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.

InnoDBIsolation Leveldeadlock
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 Architecturedatabase lockingflash sale
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.

APIBackendDistributed Systems
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.

CASLocksconcurrency
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 MechanismIdempotencyRabbitMQ
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 MechanismIdempotencyRabbitMQ
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 ConcurrencyLaravellocking
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.

SpringBootflash saleoptimistic lock
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.

IdempotencyTokenoptimistic 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
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.

Idempotencydatabaseoptimistic 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.

System Architecturebackend-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.

System Architecturecachingflash sale
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.

System Architecturedatabase scalingflash sale
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.

backend optimizationflash salehigh concurrency
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.

PHPconcurrencymysql
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.

Token Bucketjavaoptimistic 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.

Idempotencydatabasedistributed-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 Architecturedatabase shardingflash sale
0 likes · 33 min read
Flash Sale (Seckill) System Design and Technical Challenges
ITPUB
ITPUB
Apr 25, 2019 · Databases

Pessimistic vs Optimistic Locks: Choosing the Right Concurrency Control for High‑Traffic Databases

This article explains the concepts of concurrency control, detailing pessimistic and optimistic locking mechanisms, their implementation in MySQL, practical SQL examples, advantages, drawbacks such as deadlocks and ABA problems, and guidance on selecting the appropriate lock strategy for high‑concurrency applications.

CASConcurrency ControlVersioning
0 likes · 11 min read
Pessimistic vs Optimistic Locks: Choosing the Right Concurrency Control for High‑Traffic Databases
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 ControlIsolationVersion Control
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 Safetybackend optimizationflash sale
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.

Distributed SystemsIdempotencydatabase
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 concurrencySynchronization
0 likes · 14 min read
Optimistic vs Pessimistic Locks and CAS Implementation in Java
Architects' Tech Alliance
Architects' Tech Alliance
Sep 11, 2018 · Databases

Pessimistic vs Optimistic Locking: A Story-Based Explanation

This article uses a humorous story of two threads battling over inventory updates to illustrate the principles, advantages, and drawbacks of pessimistic and optimistic locking in distributed systems, helping readers understand when to apply each concurrency control method.

Concurrency ControlDistributed Systemsdatabase
0 likes · 8 min read
Pessimistic vs Optimistic Locking: A Story-Based Explanation
360 Quality & Efficiency
360 Quality & Efficiency
Jul 6, 2018 · Backend Development

Understanding Idempotency and How to Ensure It in Backend Systems

The article explains the mathematical definition of idempotency, its importance in preventing duplicate operations such as repeated payments or order creation, and presents practical strategies—including unique business IDs, optimistic locking, deduplication tables, distributed locks, token mechanisms, and payment buffering—to achieve reliable idempotent behavior in backend services.

BackendIdempotencyToken
0 likes · 6 min read
Understanding Idempotency and How to Ensure It in Backend Systems
Architecture Digest
Architecture Digest
May 14, 2018 · Backend Development

Implementing and Optimizing a High‑Concurrency Flash Sale System with Optimistic Lock, Distributed Rate Limiting, Redis Cache, and Kafka

This article walks through building a Java‑based flash‑sale (秒杀) service, diagnosing overselling issues, and progressively enhancing it with optimistic locking, distributed rate limiting, Redis caching, and asynchronous Kafka processing to achieve higher throughput and data consistency under heavy concurrency.

KafkaPerformance Testingdistributed rate limiting
0 likes · 14 min read
Implementing and Optimizing a High‑Concurrency Flash Sale System with Optimistic Lock, Distributed Rate Limiting, Redis Cache, and Kafka
ITFLY8 Architecture Home
ITFLY8 Architecture Home
Aug 17, 2017 · Backend Development

Mastering High-Concurrency Flash Sale Systems: Architecture, Challenges, and Solutions

This article dissects the technical challenges of building a high‑concurrency flash‑sale (seckill) system—covering business analysis, traffic isolation, static page caching, CDN bandwidth, dynamic order URLs, request throttling, database sharding, optimistic locking, and anti‑cheat mechanisms—while presenting concrete architectural principles and code examples.

Distributed SystemsSeckillSystem Architecture
0 likes · 36 min read
Mastering High-Concurrency Flash Sale Systems: Architecture, Challenges, and Solutions
Qunar Tech Salon
Qunar Tech Salon
Jul 25, 2017 · Databases

Schemaless Document Model for Trading System Order Storage

The article explains how a schemaless JSON document model stored in a relational database can replace traditional relational tables for trading system orders, reducing schema change costs, improving flexibility, and ensuring consistency through version‑based optimistic locking and real‑time Elasticsearch indexing.

Database designDocument ModelElasticsearch
0 likes · 8 min read
Schemaless Document Model for Trading System Order Storage
Baidu Waimai Technology Team
Baidu Waimai Technology Team
Jul 11, 2017 · Backend Development

Handling Hotspot Accounts in Baidu Waimai Financial Accounting System: Challenges and Solutions

The article examines the upgrade to a balance‑based financial accounting system, defines hotspot accounts, explains why they pose concurrency challenges, and evaluates several technical solutions—including optimistic locking, asynchronous processing, and account splitting—to guide appropriate strategy selection for different business scenarios.

Backendaccount splittingasynchronous processing
0 likes · 9 min read
Handling Hotspot Accounts in Baidu Waimai Financial Accounting System: Challenges and Solutions
Architecture Digest
Architecture Digest
Jun 14, 2017 · Backend Development

Techniques for Achieving High Concurrency: Optimistic Lock, Read‑Write Splitting, CDN, Caching, and Load Balancing

The article explains how high‑concurrency systems can be built by decomposing workloads through optimistic locking, read‑write database splitting, resource separation with CDN acceleration, dynamic‑to‑static conversion, caching, and load‑balancing strategies, providing practical code examples for each technique.

BackendCDNcaching
0 likes · 6 min read
Techniques for Achieving High Concurrency: Optimistic Lock, Read‑Write Splitting, CDN, Caching, and Load Balancing
Efficient Ops
Efficient Ops
Mar 5, 2017 · Operations

Surviving Hundred‑Billion Transactions: Real Production Incident Stories

This article recounts a series of real‑world production incidents—including massive concurrency overloads, DDoS attacks, SQL injection breaches, and critical bugs—encountered by an internet finance platform, and shares the concrete technical fixes and lessons learned to improve system resilience.

DDoSSQL injectionhigh concurrency
0 likes · 22 min read
Surviving Hundred‑Billion Transactions: Real Production Incident Stories
ITFLY8 Architecture Home
ITFLY8 Architecture Home
Dec 11, 2016 · Backend Development

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

This article analyzes the flash‑sale (seckill) business model, outlines its unique technical challenges such as impact on existing services, database load, bandwidth spikes, URL security, button activation, and order handling, and then presents a comprehensive backend architecture, design principles, code examples, database sharding, caching, and consistency strategies to reliably support massive concurrent purchases.

System Architecturebackend designcaching
0 likes · 32 min read
How to Build a High‑Concurrency Flash Sale System: Architecture, Challenges & Solutions
ITPUB
ITPUB
Oct 26, 2016 · Databases

Mastering Oracle Locks: Pessimistic, Optimistic, and Deadlock with Real‑World SQL demos

This guide explains Oracle's lock mechanisms—including shared, exclusive, row‑level, pessimistic, and optimistic locks—through step‑by‑step SQL sessions that illustrate update‑lost problems, lock contention, and deadlock detection, helping developers choose the right strategy for concurrency control.

Oracleoptimistic lockpessimistic-lock
0 likes · 10 min read
Mastering Oracle Locks: Pessimistic, Optimistic, and Deadlock with Real‑World SQL demos
Java Backend Technology
Java Backend Technology
Oct 25, 2016 · Databases

Why Locks Matter: Pessimistic vs Optimistic Concurrency Control Explained

This article explains why locks are needed in multi‑user environments, describes common conflict types such as lost updates and dirty reads, compares pessimistic and optimistic locking mechanisms, shows practical implementations with version numbers and SQL Server locks, and presents a classic financial‑system case study.

optimistic lockpessimistic-locktransaction
0 likes · 8 min read
Why Locks Matter: Pessimistic vs Optimistic Concurrency Control Explained
Qunar Tech Salon
Qunar Tech Salon
Jan 17, 2016 · Backend Development

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

This article analyzes the characteristics and technical challenges of flash‑sale (seckill) systems, proposes isolation and static‑page strategies, outlines architecture principles, detailed front‑end and service‑layer designs, discusses database sharding, caching, concurrency control, overload protection, and anti‑cheat measures to ensure reliable high‑throughput order processing.

Backend Architecturecachingflash sale
0 likes · 31 min read
Design and Technical Challenges of High‑Concurrency Flash Sale (Seckill) Systems