Tagged articles
182 articles
Page 1 of 2
dbaplus Community
dbaplus Community
May 11, 2026 · Databases

Why an Unindexed UPDATE Can Crash Your Business—and How to Prevent It

The article explains how running an UPDATE without an indexed WHERE clause in InnoDB under repeatable‑read can trigger full‑table next‑key locks that block other statements, halt the service, and how using indexed predicates, checking execution plans, enabling sql_safe_updates, or forcing an index can avoid the disaster.

InnoDBUPDATEindex
0 likes · 8 min read
Why an Unindexed UPDATE Can Crash Your Business—and How to Prevent It
Sohu Tech Products
Sohu Tech Products
Nov 26, 2025 · Databases

Master MySQL Transaction Isolation: From Dirty Reads to Serializable

This article deeply explores MySQL transaction isolation levels, explaining ACID principles, the three concurrency problems (dirty read, non‑repeatable read, phantom read), the SQL standard isolation tiers, InnoDB's MVCC and locking mechanisms, practical implementation details for each level, and guidance on choosing and configuring the appropriate isolation level for real‑world applications.

MVCCdatabaselocking
0 likes · 20 min read
Master MySQL Transaction Isolation: From Dirty Reads to Serializable
Sohu Tech Products
Sohu Tech Products
Nov 13, 2025 · Databases

Why MySQL Deadlocks Happen and How to Prevent Them

An in‑depth guide walks through MySQL InnoDB deadlock logs, explains two‑phase locking, reproduces the issue with step‑by‑step SQL commands, details lock types and compatibility, outlines common deadlock scenarios, and offers practical strategies and configuration tweaks to prevent and monitor deadlocks.

InnoDBdeadlocklocking
0 likes · 21 min read
Why MySQL Deadlocks Happen and How to Prevent Them
Xuanwu Backend Tech Stack
Xuanwu Backend Tech Stack
Oct 30, 2025 · Databases

Master MySQL Locks: From Basics to Advanced Optimizations

This article provides a comprehensive overview of MySQL's lock mechanisms, covering lock granularity, lock types, intention locks, record/gap/next‑key locks, their interaction with transaction isolation levels, two‑phase locking, deadlock handling, and practical optimization techniques for high‑concurrency applications.

Isolation Levelsconcurrencydeadlock
0 likes · 20 min read
Master MySQL Locks: From Basics to Advanced Optimizations
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
ITPUB
ITPUB
Oct 17, 2025 · Databases

Why Some Companies Switch MySQL from Repeatable Read to Read Committed

The article explains MySQL's default Repeatable Read isolation level, how its lock and binlog mechanisms affect consistency and replication, and why many high‑traffic internet firms change to Read Committed to boost concurrency and reduce deadlocks despite the need to handle phantom reads.

Isolation LevelRead CommittedRepeatable Read
0 likes · 8 min read
Why Some Companies Switch MySQL from Repeatable Read to Read Committed
Architect's Guide
Architect's Guide
Jul 24, 2025 · Backend Development

7 Proven Strategies to Prevent Overselling in High‑Concurrency Flash Sales (SpringBoot)

This article explores high‑concurrency flash‑sale scenarios, demonstrates why naïve @Transactional and lock usage can still cause overselling, and presents seven concrete implementations—including improved lock, AOP lock, two pessimistic‑lock variants, optimistic lock, a blocking queue, and a Disruptor queue—complete with SpringBoot code, JMeter testing results, and performance analysis.

Distributed SystemsSpringBootconcurrency
0 likes · 23 min read
7 Proven Strategies to Prevent Overselling in High‑Concurrency Flash Sales (SpringBoot)
Su San Talks Tech
Su San Talks Tech
Jul 15, 2025 · Databases

Unlock MySQL Performance: 8 Lock Types, Deadlock Solutions, and Optimization Tips

This article explains MySQL's eight lock mechanisms, their purposes and classifications, demonstrates row‑level, gap, next‑key, table and metadata locks with code examples, discusses deadlock scenarios and detection, and provides practical monitoring and optimization strategies to improve concurrency and reliability.

Database OptimizationIsolation Levelsconcurrency
0 likes · 10 min read
Unlock MySQL Performance: 8 Lock Types, Deadlock Solutions, and Optimization Tips
Code Ape Tech Column
Code Ape Tech Column
Jun 22, 2025 · Databases

How KeyDB Transforms Redis with Multi‑Threading: Architecture & Locks

KeyDB, a Redis fork, replaces the single‑threaded design with a multi‑threaded architecture using a main thread and worker I/O threads, SO_REUSEPORT, per‑thread connection lists, fastlock spin‑lock mechanisms, asynchronous pipelines, and active‑replica support, enabling higher concurrency while remaining 100 % Redis‑compatible.

Connection ManagementKeyDBdatabase
0 likes · 8 min read
How KeyDB Transforms Redis with Multi‑Threading: Architecture & Locks
IT Services Circle
IT Services Circle
May 10, 2025 · Backend Development

Understanding Java synchronized: Locks, Optimizations, and Example Code

This article explains how Java's synchronized keyword works, covering object and class locks, lock upgrades such as biased, lightweight, and heavyweight locks, the underlying monitor implementation, example code for a thread‑safe counter, and performance considerations for high‑concurrency scenarios.

concurrencyjavalocking
0 likes · 7 min read
Understanding Java synchronized: Locks, Optimizations, and Example Code
Cognitive Technology Team
Cognitive Technology Team
May 5, 2025 · Fundamentals

Evolution of Java ConcurrentHashMap: From Segment Locks to CAS + synchronized (Java 7 vs Java 8)

This article examines the evolution of Java's ConcurrentHashMap, comparing the segment‑lock implementation in Java 7 with the CAS‑plus‑synchronized, bucket‑level locking and red‑black tree enhancements introduced in Java 8, covering lock mechanisms, data structures, resizing strategies, core operations, performance and suitable use cases.

ConcurrentHashMapDataStructureconcurrency
0 likes · 11 min read
Evolution of Java ConcurrentHashMap: From Segment Locks to CAS + synchronized (Java 7 vs Java 8)
Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
Apr 1, 2025 · Fundamentals

Why Do Deadlocks Happen and How Can You Prevent Them?

This article explains what deadlocks are, outlines the four classic conditions that cause them, provides Java thread and MySQL transaction examples, and offers practical solutions such as consistent lock ordering, timeout settings, batch updates, and shortening transaction duration to prevent deadlocks.

concurrencydatabasedeadlock
0 likes · 5 min read
Why Do Deadlocks Happen and How Can You Prevent Them?
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
Code Mala Tang
Code Mala Tang
Feb 20, 2025 · Fundamentals

Mastering Lock Mechanisms: From Mutexes to Distributed Locks in Python

This comprehensive guide explores why locks are essential in concurrent programming, explains the principles behind mutexes, semaphores, read‑write locks, and re‑entrant locks, provides Python code examples, discusses common pitfalls like deadlocks, and offers best‑practice strategies for production environments.

Synchronizationconcurrencydeadlock
0 likes · 22 min read
Mastering Lock Mechanisms: From Mutexes to Distributed Locks in Python
Pan Zhi's Tech Notes
Pan Zhi's Tech Notes
Feb 20, 2025 · Databases

Mastering Database Concurrency: Dirty Read, Non‑Repeatable Read, and Phantom Read

The article explains ACID properties, details how inadequate isolation levels cause dirty reads, non‑repeatable reads, and phantom reads, illustrates each with transaction scenarios and diagrams, and shows how MySQL’s lock types and isolation settings prevent these anomalies, noting the trade‑off between isolation and concurrency.

databasedirty readlocking
0 likes · 9 min read
Mastering Database Concurrency: Dirty Read, Non‑Repeatable Read, and Phantom Read
macrozheng
macrozheng
Feb 6, 2025 · Databases

How KeyDB Transforms Redis into a Multi‑Threaded Database

KeyDB, a Redis fork, replaces the single‑threaded architecture with a multi‑threaded model using a main thread and worker I/O threads, SO_REUSEPORT, per‑thread connection management, fastlock spin‑lock mechanisms, and active‑replica support, enabling concurrent data access and improved performance.

Connection ManagementKeyDBlocking
0 likes · 9 min read
How KeyDB Transforms Redis into a Multi‑Threaded Database
Code Ape Tech Column
Code Ape Tech Column
Jan 8, 2025 · Backend Development

Implementing High‑Concurrency Flash‑Sale (Seckill) in SpringBoot: Locking Strategies, Queue Solutions, and Performance Testing

This article demonstrates how to simulate a high‑concurrency flash‑sale scenario using SpringBoot, MySQL, Mybatis‑Plus and JMeter, analyzes the overselling problem caused by premature lock release, and presents seven solutions—including lock‑first strategies, AOP, pessimistic and optimistic locks, and queue‑based approaches—along with code samples and test results.

JMeterQueueSeckill
0 likes · 19 min read
Implementing High‑Concurrency Flash‑Sale (Seckill) in SpringBoot: Locking Strategies, Queue Solutions, and Performance Testing
JD Retail Technology
JD Retail Technology
Nov 5, 2024 · Backend Development

Ensuring Inventory Consistency Under Concurrent Operations: Locking Pitfalls and Solutions

The article examines how frequent inventory adjustments in JD retail supply‑chain can suffer from concurrency issues, explains why traditional locking may fail, analyzes a real‑world case of lock misuse, and presents code‑level, database‑level, and architectural solutions to guarantee data consistency.

Consistencyconcurrencydatabase
0 likes · 7 min read
Ensuring Inventory Consistency Under Concurrent Operations: Locking Pitfalls and Solutions
JavaEdge
JavaEdge
Oct 28, 2024 · Databases

Why Do MySQL Transactions Deadlock? Reproduce and Prevent InnoDB Deadlocks

This article explains how MySQL InnoDB deadlocks occur during order‑record idempotency checks, demonstrates step‑by‑step reproduction with SQL scripts, analyzes the lock types involved, and provides practical strategies to avoid and resolve such deadlocks in production systems.

InnoDBdatabasedeadlock
0 likes · 13 min read
Why Do MySQL Transactions Deadlock? Reproduce and Prevent InnoDB Deadlocks
Alibaba Cloud Developer
Alibaba Cloud Developer
Oct 10, 2024 · Databases

Inside MySQL 8.0: How Table, Page, and Row Locks Manage Concurrency

This article provides a comprehensive overview of MySQL 8.0's concurrency control mechanisms, detailing table‑level MDL locks, server‑ and engine‑layer table locks, page‑level B+Tree locking, and row‑level lock types with code examples and real‑world deadlock scenarios.

Concurrency ControlDatabase InternalsInnoDB
0 likes · 28 min read
Inside MySQL 8.0: How Table, Page, and Row Locks Manage Concurrency
Sohu Tech Products
Sohu Tech Products
Sep 5, 2024 · Databases

How to Diagnose and Resolve MySQL InnoDB Deadlocks: A Step-by-Step Guide

This article walks through a real‑world MySQL InnoDB deadlock case, detailing log analysis, reproducing the issue with test data, explaining gap and insert‑intention locks, and presenting a practical solution that checks existence before updating or inserting to prevent deadlocks.

Database PerformanceInnoDBdeadlock
0 likes · 14 min read
How to Diagnose and Resolve MySQL InnoDB Deadlocks: A Step-by-Step Guide
Zhuanzhuan Tech
Zhuanzhuan Tech
Aug 27, 2024 · Databases

MySQL InnoDB Deadlock Analysis and Resolution Guide

This article presents a detailed walkthrough of a MySQL InnoDB deadlock case, covering background, log inspection, data preparation, reproduction steps, lock analysis, root‑cause explanation, and practical solutions to prevent and resolve similar deadlock issues.

InnoDBdatabasedeadlock
0 likes · 14 min read
MySQL InnoDB Deadlock Analysis and Resolution Guide
Linux Kernel Journey
Linux Kernel Journey
Aug 25, 2024 · Fundamentals

Analyzing Linux Memory Management Locks and Key Optimization Cases

The article examines the role of various locks in Linux kernel memory management, explains their APIs and sleeping constraints, presents detailed case studies of lock‑related performance patches—including per‑memcg LRU, mmap_lock IO‑fault path, SPF, PVL, fault‑around, unmap, and rmap lockless optimizations—and summarizes common strategies for reducing lock contention and improving scalability.

LinuxMemory Managementkernel
0 likes · 28 min read
Analyzing Linux Memory Management Locks and Key Optimization Cases
Zhuanzhuan Tech
Zhuanzhuan Tech
Jul 3, 2024 · Databases

Analysis of MySQL DELETE Deadlock and Locking Mechanisms

This article examines why identical DELETE statements on a MySQL table with a unique index can cause deadlocks, reviews InnoDB lock types, reproduces the issue with SQL and Java code, and discusses mitigation strategies such as version upgrades, isolation level changes, and distributed locks.

DELETEInnoDBdatabase
0 likes · 14 min read
Analysis of MySQL DELETE Deadlock and Locking Mechanisms
Tencent Cloud Developer
Tencent Cloud Developer
Jun 25, 2024 · Backend Development

Understanding the Challenges of Distributed Transactions in Microservices

The article explains that distributed transactions in micro‑service architectures are difficult because they must guarantee atomicity across heterogeneous services, handle time‑outs, and reconcile results using unique transaction IDs, undo‑logs, or NoSQL strategies, while balancing locking, availability, and consistency trade‑offs.

Distributed TransactionsIdempotencyMicroservices
0 likes · 18 min read
Understanding the Challenges of Distributed Transactions in Microservices
Architecture & Thinking
Architecture & Thinking
Apr 16, 2024 · Databases

Master MySQL InnoDB Locks: How SELECT…FOR UPDATE Behaves

This article explains the default repeatable‑read isolation level in InnoDB, details the three main lock types—record, gap, and next‑key—and shows how SELECT … FOR UPDATE applies different locking rules depending on primary key, unique, ordinary, range, or table‑scan queries, with practical SQL examples.

Database ConcurrencyInnoDBSELECT FOR UPDATE
0 likes · 10 min read
Master MySQL InnoDB Locks: How SELECT…FOR UPDATE Behaves
Java Captain
Java Captain
Mar 7, 2024 · Backend Development

Applying Java Annotations in Concurrent Programming

This article explores how Java's annotation mechanism, introduced in JDK 5.0, can be leveraged to address concurrency challenges by providing thread-safety, locking, timeout, and asynchronous execution annotations, and discusses their integration with AOP for enhanced thread management and performance.

Timeoutannotationsaop
0 likes · 5 min read
Applying Java Annotations in Concurrent Programming
Cognitive Technology Team
Cognitive Technology Team
Feb 19, 2024 · Databases

Understanding MySQL Deadlocks and How to Prevent Them

This article explains MySQL deadlocks, describing how they occur in InnoDB due to resource contention, outlines common causes such as race conditions, poor indexing, long transactions, lock upgrades, and provides practical prevention strategies including deadlock detection, short transactions, query optimization, lock timeouts, monitoring tools, lock ordering, and appropriate lock levels.

InnoDBdatabasedeadlock
0 likes · 5 min read
Understanding MySQL Deadlocks and How to Prevent Them
Wukong Talks Architecture
Wukong Talks Architecture
Dec 24, 2023 · Databases

MySQL Indexes, Lock Types, Transaction Isolation Levels, and Deadlock Analysis

This article explains MySQL index structures, covers covered and back‑table queries, details InnoDB transaction isolation levels, classifies various lock types (table, row, gap, next‑key, intention, auto‑inc, metadata), analyzes lock behavior in multiple scenarios, discusses deadlock causes, and provides DDL and online schema‑change recommendations.

DDLOnline Schema Changedeadlock
0 likes · 61 min read
MySQL Indexes, Lock Types, Transaction Isolation Levels, and Deadlock Analysis
Efficient Ops
Efficient Ops
Dec 6, 2023 · Databases

When and How to Use MySQL Locks: A Deep Dive into Explicit and Implicit Locking

This article explains MySQL's explicit and implicit locking mechanisms, illustrates how transaction isolation levels affect lock scope, provides practical SQL examples for various scenarios, and offers guidelines on when to apply pessimistic locks versus optimistic approaches to maintain database performance.

databaselockingmysql
0 likes · 13 min read
When and How to Use MySQL Locks: A Deep Dive into Explicit and Implicit Locking
Top Architect
Top Architect
Nov 22, 2023 · Backend Development

Solving Product Overselling in High‑Concurrency Scenarios: Seven Implementation Methods

This article analyzes the overselling problem that occurs during high‑concurrency flash‑sale (seckill) operations and presents seven concrete solutions—including improved lock placement, AOP‑based locking, three types of database locks, optimistic locking, a blocking‑queue approach, and a Disruptor queue—complete with SpringBoot 2.5.7 code samples, performance test results, and practical recommendations.

DistributedSystemsSeckillSpringBoot
0 likes · 20 min read
Solving Product Overselling in High‑Concurrency Scenarios: Seven Implementation Methods
MaGe Linux Operations
MaGe Linux Operations
Nov 18, 2023 · Databases

Understanding SQL Server Deadlocks: Causes, Detection, and Prevention

This article explains the principle of deadlocks, the four necessary conditions, how they manifest in SQL Server resources, methods for investigating deadlocks with system procedures and Profiler, and practical techniques—including isolation level changes, lock timeouts, and bound sessions—to avoid and resolve them.

SQL Serverdeadlocklocking
0 likes · 17 min read
Understanding SQL Server Deadlocks: Causes, Detection, and Prevention
Su San Talks Tech
Su San Talks Tech
Nov 15, 2023 · Databases

Understanding MySQL SELECT … FOR UPDATE Locks: Row, Gap, or Table?

This article explains how MySQL's SELECT … FOR UPDATE statement applies different lock types—row, gap, or table—depending on whether the WHERE clause uses primary keys, unique indexes, regular indexes, range queries, or empty results, and demonstrates each case with practical SQL examples and screenshots.

Gap LockSELECT FOR UPDATElocking
0 likes · 10 min read
Understanding MySQL SELECT … FOR UPDATE Locks: Row, Gap, or Table?
Tencent Cloud Developer
Tencent Cloud Developer
Nov 6, 2023 · Databases

MySQL Lock Mechanisms: When, How, and When Not to Use

The article explains MySQL’s explicit and implicit lock mechanisms—including SELECT … FOR UPDATE, metadata, row, gap, and next‑key locks—how isolation levels affect them, and offers practical guidelines such as using optimistic locking, indexing locked columns, and avoiding long transactions to prevent phantom reads, deadlocks, and performance issues.

Database PerformanceInnoDBlocking
0 likes · 15 min read
MySQL Lock Mechanisms: When, How, and When Not to Use
ITPUB
ITPUB
Oct 25, 2023 · Databases

SELECT FOR UPDATE: When MySQL Locks Rows vs. Tables – 20 Tested Scenarios

This article systematically investigates how MySQL's SELECT FOR UPDATE behaves under different versions (5.7 and 8.0) and isolation levels (RR and RC), covering twenty scenarios that vary by index type and query range, and summarizes whether the statement acquires row‑level, gap, or table‑level locks.

SELECT FOR UPDATElockingmysql
0 likes · 21 min read
SELECT FOR UPDATE: When MySQL Locks Rows vs. Tables – 20 Tested Scenarios
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Oct 25, 2023 · Databases

Optimizing Transaction SQL for High‑Concurrency Sales Events: Comparing Two Transaction Approaches

The article analyzes how to improve inventory‑update transactions during massive sales periods by comparing two SQL transaction patterns, calculating their TPS under defined latency assumptions, and suggesting that placing the row lock closer to the commit yields significantly higher throughput.

Database OptimizationTPSlocking
0 likes · 7 min read
Optimizing Transaction SQL for High‑Concurrency Sales Events: Comparing Two Transaction Approaches
FunTester
FunTester
Oct 24, 2023 · Backend Development

Using java.util.concurrent.locks.ReentrantLock: Blocking, Interruptible, and Timed Locks in Java

This article explains thread safety in Java multithreading, introduces the ReentrantLock class from java.util.concurrent.locks, demonstrates blocking, interruptible, and timed lock usage with code examples, discusses best practices, fairness, reentrancy, and performance considerations for effective concurrency control.

ReentrantLockconcurrencyjava
0 likes · 8 min read
Using java.util.concurrent.locks.ReentrantLock: Blocking, Interruptible, and Timed Locks in Java
dbaplus Community
dbaplus Community
Sep 14, 2023 · Databases

Master MySQL InnoDB Locks: From Row Locks to Deadlock Prevention

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—covers lock compatibility, deadlock causes and prevention, compares optimistic and pessimistic locking, and shows how SELECT FOR UPDATE behaves under different isolation levels.

InnoDBconcurrencydeadlock
0 likes · 20 min read
Master MySQL InnoDB Locks: From Row Locks to Deadlock Prevention
macrozheng
macrozheng
Sep 3, 2023 · Databases

Why a Single UPDATE Can Crash Your MySQL Database and How to Prevent It

This article explains how an UPDATE without indexed WHERE conditions can trigger full‑table next‑key locks in InnoDB, causing business downtime, and provides practical safeguards such as enabling sql_safe_updates and using FORCE INDEX to ensure safe execution.

InnoDBUPDATEindexes
0 likes · 8 min read
Why a Single UPDATE Can Crash Your MySQL Database and How to Prevent It
Sanyou's Java Diary
Sanyou's Java Diary
Aug 7, 2023 · Databases

What Locks Does SELECT FOR UPDATE Use? 20 MySQL Scenarios Revealed

This article experimentally verifies how SELECT FOR UPDATE behaves under MySQL 5.7 and 8.0 with both REPEATABLE‑READ and READ‑COMMITTED isolation levels, covering primary keys, unique indexes, ordinary indexes, no indexes and range queries, and summarizes when row‑level, gap‑level or table‑level locks are taken.

Database PerformanceSELECT FOR UPDATElocking
0 likes · 23 min read
What Locks Does SELECT FOR UPDATE Use? 20 MySQL Scenarios Revealed
Top Architect
Top Architect
Jul 20, 2023 · Backend Development

Solving Product Overselling in High‑Concurrency Flash Sale Scenarios: Seven Implementation Approaches

This article analyzes the common overselling problem in high‑traffic flash‑sale systems and presents seven concrete solutions—including improved locking, AOP locking, pessimistic and optimistic locks, as well as blocking‑queue and Disruptor‑based designs—complete with SpringBoot code samples and performance testing results.

QueueSpringBootconcurrency
0 likes · 20 min read
Solving Product Overselling in High‑Concurrency Flash Sale Scenarios: Seven Implementation Approaches
dbaplus Community
dbaplus Community
Jul 13, 2023 · Databases

Understanding InnoDB Row Locks: Rules, Types, and Real-World Examples

This article explains InnoDB's three row‑lock types, when they are applied implicitly or explicitly, the two core locking principles, and walks through concrete examples for unique and non‑unique index equality and range queries, showing exact lock ranges and lock‑type degradations.

InnoDBlockingmysql
0 likes · 10 min read
Understanding InnoDB Row Locks: Rules, Types, and Real-World Examples
Aikesheng Open Source Community
Aikesheng Open Source Community
Jun 6, 2023 · Databases

Why Does Inserting a Record that Triggers a Unique Index Conflict Add a Next‑Key Exclusive Lock on the Primary‑Key Supremum Record?

This article reproduces a MySQL 8.0.32 InnoDB scenario where inserting a row that violates a unique index causes a next‑key exclusive lock on the primary‑key supremum record, explains the underlying implicit‑lock mechanism, walks through the relevant source‑code stack, and details the lock‑conversion and rollback steps under REPEATABLE‑READ isolation.

Database InternalsInnoDBRepeatable Read
0 likes · 25 min read
Why Does Inserting a Record that Triggers a Unique Index Conflict Add a Next‑Key Exclusive Lock on the Primary‑Key Supremum Record?
Architect's Guide
Architect's Guide
May 21, 2023 · Backend Development

Solving Product Overselling in High‑Concurrency Flash‑Sale (Seckill) with Multiple Locking Strategies

This article analyzes the overselling problem that occurs during high‑concurrency flash‑sale scenarios, demonstrates seven concrete implementations—including improved lock, AOP lock, pessimistic and optimistic database locks, blocking‑queue and Disruptor‑based queues—using SpringBoot, MySQL and JMeter, and summarizes their performance characteristics and trade‑offs.

Queuelocking
0 likes · 18 min read
Solving Product Overselling in High‑Concurrency Flash‑Sale (Seckill) with Multiple Locking Strategies
php Courses
php Courses
Apr 28, 2023 · Backend Development

Implementing Lock and Unlock Operations with PHP and Redis

This article explains how to use PHP and Redis to create a blocking lock for a game room, safely add users while preventing dirty reads, and release the lock atomically with a Lua script, providing complete code examples and practical tips.

LuaPHPlocking
0 likes · 4 min read
Implementing Lock and Unlock Operations with PHP and Redis
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
政采云技术
政采云技术
Feb 23, 2023 · Databases

Understanding Next-Key Lock Deadlocks in MySQL: Analysis and Solutions

This article examines how common business operations using SELECT ... FOR UPDATE and INSERT can cause MySQL Next‑Key lock deadlocks, explains the underlying gap‑lock and row‑lock mechanisms, demonstrates practical experiments, and proposes strategies such as postponing locks or using primary‑key updates to avoid such deadlocks.

Next-key Lockdatabasedeadlock
0 likes · 14 min read
Understanding Next-Key Lock Deadlocks in MySQL: Analysis and Solutions
Liangxu Linux
Liangxu Linux
Feb 18, 2023 · Databases

Why Does One MySQL UPDATE Block While Another Doesn’t? Deep Dive into InnoDB Locks

The article explains why an UPDATE on the same row in MySQL can block in one transaction but not in another, by analyzing the types of row‑level locks (record, next‑key, gap) acquired during SELECT … FOR UPDATE, normal updates, and updates that modify primary‑key values, illustrating the lock behavior with B+‑tree examples.

B+TreeInnoDBUPDATE
0 likes · 8 min read
Why Does One MySQL UPDATE Block While Another Doesn’t? Deep Dive into InnoDB Locks
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
Top Architect
Top Architect
Feb 9, 2023 · Backend Development

High-Concurrency Seckill Implementation in SpringBoot: Locking, Transaction, and Queue Strategies

This article demonstrates how to simulate high‑concurrency flash‑sale scenarios using SpringBoot, MySQL, and JMeter, and compares seven approaches—including lock‑based, AOP, pessimistic and optimistic locking, and queue‑based solutions such as BlockingQueue and Disruptor—to prevent overselling and improve performance.

DistributedQueueSeckill
0 likes · 19 min read
High-Concurrency Seckill Implementation in SpringBoot: Locking, Transaction, and Queue Strategies
IT Architects Alliance
IT Architects Alliance
Feb 3, 2023 · Backend Development

Preventing Overselling in High‑Concurrency Flash Sales: 7 Locking & Queue Strategies with SpringBoot

This article analyzes the overselling problem in high‑concurrency flash‑sale scenarios, demonstrates seven concrete solutions—including improved locks, AOP locks, pessimistic and optimistic database locks, and queue‑based approaches using BlockingQueue and Disruptor—provides full SpringBoot code, JMeter test results, and practical recommendations for reliable stock reduction.

BackendDisruptorJMeter
0 likes · 19 min read
Preventing Overselling in High‑Concurrency Flash Sales: 7 Locking & Queue Strategies with SpringBoot
ITPUB
ITPUB
Jan 26, 2023 · Databases

What Locks Does SELECT … FOR UPDATE Acquire Under Different Isolation Levels?

This article experimentally demonstrates how MySQL's SELECT … FOR UPDATE statement acquires various locks—IX, X, and gap locks—under RC (read‑committed) and RR (repeatable‑read) isolation levels with unique, primary, normal, and missing indexes, revealing when row‑level versus table‑level locking occurs.

Database ConcurrencyInnoDBIsolation Levels
0 likes · 16 min read
What Locks Does SELECT … FOR UPDATE Acquire Under Different Isolation Levels?
Top Architect
Top Architect
Jan 5, 2023 · Backend Development

Resolving Overselling in High‑Concurrency Flash Sale: Seven Locking and Queue Strategies in SpringBoot

This article analyzes why simple @Transactional and lock annotations still cause overselling in flash‑sale scenarios, then presents seven backend solutions—including improved controller locking, AOP locking, pessimistic and optimistic database locks, and queue‑based approaches with BlockingQueue and Disruptor—along with code samples and JMeter test results.

DistributedSystemsJMeterQueue
0 likes · 20 min read
Resolving Overselling in High‑Concurrency Flash Sale: Seven Locking and Queue Strategies in SpringBoot
政采云技术
政采云技术
Jul 28, 2022 · Databases

Analyzing and Resolving MySQL Next‑Key Lock Deadlocks: A Practical Case Study

This article walks through a real MySQL deadlock scenario, explaining the four necessary deadlock conditions, illustrating how Next‑Key locks on non‑unique indexes cause gap locks, and presenting step‑by‑step analysis, experimental verification, and practical recommendations to avoid such deadlocks in production systems.

Next-key Lockdatabasedeadlock
0 likes · 15 min read
Analyzing and Resolving MySQL Next‑Key Lock Deadlocks: A Practical Case Study
DeWu Technology
DeWu Technology
Jul 11, 2022 · Databases

SQL Fine-Grained Management and Concurrency Control Best Practices

The guide recommends fine‑grained MySQL management in a MyBatis‑based order system—avoiding generic or dynamic SQL, explicitly using indexes, listing columns, limiting results, batching inserts, and checking row counts—while applying appropriate concurrency control (pessimistic FOR UPDATE or optimistic versioning) to improve performance, stability, and data integrity.

Concurrency ControlDatabase OptimizationMyBatis
0 likes · 18 min read
SQL Fine-Grained Management and Concurrency Control Best Practices
Laravel Tech Community
Laravel Tech Community
Jun 22, 2022 · Databases

Understanding MySQL SELECT ... FOR UPDATE: When It Locks Rows vs. Tables

This article explains how a plain SELECT does not lock data, while SELECT … FOR UPDATE adds a pessimistic lock whose scope—row or table—depends on whether the query uses an indexed or primary‑key column, and demonstrates the behavior with SQL examples and transaction scenarios.

Database TransactionsSELECT FOR UPDATElocking
0 likes · 4 min read
Understanding MySQL SELECT ... FOR UPDATE: When It Locks Rows vs. Tables
Top Architect
Top Architect
Jun 22, 2022 · Databases

Understanding SELECT ... FOR UPDATE Locking in MySQL: Row vs. Table Locks

This article explains how the SELECT ... FOR UPDATE statement in MySQL adds a pessimistic lock, describes when it results in a row lock versus a table lock based on index usage, provides verification SQL, example scenarios, and practical tips for transaction handling.

SELECT FOR UPDATEdatabaselocking
0 likes · 5 min read
Understanding SELECT ... FOR UPDATE Locking in MySQL: Row vs. Table Locks
Tencent Cloud Developer
Tencent Cloud Developer
Jun 8, 2022 · Backend Development

Understanding Go Map and Slice Concurrency Safety and Parameter Passing

The article explains that Go maps and slices are not safe for concurrent reads or writes, describes how the runtime detects map violations, and recommends using sync.Mutex, sync.RWMutex, or sync.Map for maps and external synchronization for slices, while also clarifying that passing these reference types to functions shares underlying data unless explicitly copied.

GoMAPParameter Passing
0 likes · 12 min read
Understanding Go Map and Slice Concurrency Safety and Parameter Passing
政采云技术
政采云技术
Jun 7, 2022 · Databases

Understanding MySQL Auto‑Increment Locks and Their Behaviors

This article explains the concept of MySQL auto‑increment locks, describes different insertion methods and lock modes, analyzes how InnoDB allocates and manages auto‑increment IDs—including simple, bulk, and mixed inserts—and provides source‑code insights, practical experiments, and mitigation strategies for ID continuity issues.

InnoDBauto_incrementdatabase
0 likes · 21 min read
Understanding MySQL Auto‑Increment Locks and Their Behaviors
IT Architects Alliance
IT Architects Alliance
Apr 24, 2022 · Backend Development

Distributed Locks and Idempotency: Principles, Implementations, and the Cerberus Solution

This article explains the challenges of mutual exclusion and idempotency in distributed systems, reviews Java concurrency primitives, compares common distributed lock implementations such as Zookeeper, Redis, and Tair, and introduces Cerberus and GTIS as robust solutions for high‑availability and repeatable operations.

CerberusDistributed SystemsGTIS
0 likes · 31 min read
Distributed Locks and Idempotency: Principles, Implementations, and the Cerberus Solution
政采云技术
政采云技术
Mar 17, 2022 · Databases

InnoDB Lock System: Types, Modes, Structures, and Compatibility

This article explains InnoDB's lock system in MySQL, covering lock granularity, intent, shared, exclusive and auto‑increment locks, row‑lock types, the underlying C++ structures, lock mode and type encoding, and the compatibility and strength matrices that govern lock acquisition and waiting.

InnoDBc++concurrency
0 likes · 13 min read
InnoDB Lock System: Types, Modes, Structures, and Compatibility
Su San Talks Tech
Su San Talks Tech
Feb 23, 2022 · Fundamentals

Why Does synchronized Fail with Integer Locks? Deep Dive into Java Concurrency

This article examines why Java's synchronized keyword can become ineffective when locking on an Integer object, explores how autoboxing and Integer caching cause lock objects to change, and presents reliable alternatives such as class‑level locks or explicit lock maps for safe multithreaded programming.

concurrencyintegerlocking
0 likes · 18 min read
Why Does synchronized Fail with Integer Locks? Deep Dive into Java Concurrency
dbaplus Community
dbaplus Community
Feb 21, 2022 · Databases

Why Updating Non‑Indexed Columns Can Lock the Whole Table in MySQL

Through a series of MySQL 5.7.26 experiments the article reveals how record‑level locks are applied to primary‑key indexes when non‑indexed columns are locked, how isolation levels (READ COMMITTED vs REPEATABLE READ) change the locking order, and why both SELECT … FOR UPDATE and UPDATE statements can block other transactions.

InnoDBIsolation LevelsRecord Locks
0 likes · 14 min read
Why Updating Non‑Indexed Columns Can Lock the Whole Table in MySQL