This article explains the inner workings of etcd, covering its Raft consensus implementation, node election and state management, as well as the persistent storage layer built on BoltDB, and includes detailed code excerpts to illustrate each component.
This article describes the architecture, design requirements, and implementation of a modular transaction settlement testing system that separates testing from order modules, supports flexible split‑payment configurations, and ensures accurate fund flow verification across various business scenarios.
This article explains MySQL shared (S) and exclusive (X) row‑level locks, demonstrates their behavior with two concurrent sessions, shows how lock ordering can cause deadlocks, and provides practical tips for using InnoDB locking correctly.
This article explains the fundamentals of database transactions, the ACID properties, and how they are implemented, then delves into distributed transaction challenges and solutions such as two‑phase commit, three‑phase commit, XA, and Saga patterns, highlighting their trade‑offs and practical usage.
This article explains the purpose, content, generation timing, storage files, and release mechanisms of MySQL's redo log, undo log, and binary log, highlighting their roles in transaction durability, MVCC, and replication, and clarifying key differences and interactions among them.
This guide provides a comprehensive overview of MySQL fundamentals—including CRUD statements, table creation, index management, data manipulation, transaction control, stored procedures, and trigger creation—complete with syntax examples and practical tips for reliable database development.
This article explains the consequences of high‑traffic spikes, presents practical database and code‑level strategies to keep data consistent, and outlines server‑side architectures—including load balancing, caching, and Redis queues—to sustain massive concurrent requests without crashing.
This tutorial walks through creating a basic Java blockchain that includes block structures, transaction modeling, a proof‑of‑work mining process with configurable difficulty, and functions to compute wallet balances, providing complete source code and explanatory diagrams.
This article compiles essential MySQL interview topics, covering ACID transaction properties, isolation levels and their issues, storage engine differences, index types, query execution order, lock mechanisms, temporary tables, normalization, read‑write splitting, performance tuning, and recovery logs, providing concise explanations and examples for each concept.
This article explains the challenges of high‑concurrency flash‑sale systems, analyzes the overselling problem caused by simultaneous database updates, and presents four optimization strategies—including unsigned fields, MySQL transactions, file locks, and Redis queues—accompanied by complete PHP code examples and test data.
This article explains the fundamentals of database transactions, the ACID properties, and how they are implemented in relational systems before exploring distributed transaction challenges and solutions such as 2PC, 3PC, TCC, and message‑based approaches.
This article explores how distributed systems determine node liveness, manage failover and recovery, and implement at‑most‑once, at‑least‑once, and exactly‑once processing guarantees—including opaque transactions and two‑phase commit—using examples from Kafka, Zookeeper, and big‑data pipelines.
The article walks through a puzzling MySQL deadlock caused by two concurrent transactions on a table with a unique index, explains how to read the InnoDB status output, identifies the lock types and order, and shows a detailed step‑by‑step reconstruction of the deadlock scenario.
This article provides a clear, step‑by‑step explanation of database transactions, covering the ACID properties, how atomicity, consistency, isolation, and durability are implemented, and introduces MVCC as a modern concurrency control technique with practical examples and diagrams.
This article explains how HBase achieves scalable region auto‑splitting, detailing the various split policies, the algorithm for locating split points, the transactional split workflow, reference file handling, data migration via compaction, cleanup procedures, and common troubleshooting tips.
This article explains how concurrent transactions updating the same MySQL InnoDB row can cause inconsistent results, reviews InnoDB isolation levels and lock types, and demonstrates using SERIALIZABLE isolation combined with exclusive row locks in Sequelize to ensure correct sequential updates.
This article explains the challenges of consistency in distributed systems, introduces the CAP theorem and ACID properties, describes common distributed transaction techniques such as local message tables, transactional message middleware like RocketMQ, and details the two‑phase and three‑phase commit protocols with their advantages and drawbacks.
This tutorial explains how to operate MySQL from Python using three different techniques—plain procedural code, object‑oriented classes, and modular imports—while covering __name__ handling, command‑line arguments, transaction management, and practical banking transfer examples.
This article provides a comprehensive overview of SQLite, covering its file‑based embedded architecture, type affinity, core components, supported data types, essential API functions, transaction management, and techniques for storing and retrieving binary data in embedded applications.
The article explains why a MySQL UPDATE statement took five seconds by examining binlog entries, distinguishing slow‑query scans from lock‑waits, and using a Bash script to identify long‑running transactions that reveal hidden lock contention.
This article explains how MySQL binlog timestamps are derived from the THD start_time, why all events in a transaction share the same timestamp, how exec_time is calculated, and demonstrates the effect of autocommit and manual commit on binlog timing through concrete examples and source code analysis.
This article explains MySQL InnoDB's locking mechanisms—including MVCC snapshot vs. current reads, two‑phase locking, isolation levels, lock types, GAP locks, and deadlock scenarios—by analyzing simple and complex SQL examples and showing how different index and isolation configurations affect lock acquisition.
This article dissects the InnoDB transaction structure defined in storage/innobase/include/trx0trx.h, detailing each of the 63 variables—including their types, purpose, and interaction with MySQL’s transaction coordinator—so readers can grasp how InnoDB ensures data consistency and manages transaction state.
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.
This article explains the four MySQL isolation levels, their effects such as dirty reads, non‑repeatable reads and phantom reads, shows how to view and change the isolation level, and reviews the ACID principles of atomicity, consistency, isolation, and durability.
The article explains how concurrent transactions can cause deadlocks when resources are locked, and introduces the Actor model—combining data, behavior, and message passing—to give data its own active logic, thereby naturally handling concurrency and avoiding such deadlocks.
Facing high maintenance costs, complex business demands, and costly Microsoft tech, a company migrated its five‑year‑old transaction platform to Java, employing phased refactoring, comparative testing, and traffic‑splitting to ensure correctness, minimal impact, and a smooth, zero‑downtime rollout with centralized configuration and logging.
This article explains the internal structures and roles of Oracle undo and redo logs in transaction processing, walks through practical experiments that dissect undo segment headers, undo blocks, undo chains, redo records, fast‑commit behavior, and the true nature of DELETE operations, and shows how these insights help diagnose ORA‑600 startup failures.
This article presents a comprehensive technical overview of TiDB, a NewSQL distributed database, covering its architecture, SQL layer, KV engine, distributed transaction mechanisms, code implementation in Go, open‑source practices, and future roadmap.
This article explores how to maintain data consistency across services by using local transactions, two‑phase commit distributed transactions, and reliable message‑queue patterns, illustrating each method with an Alipay‑to‑YuEBao transfer example and discussing their trade‑offs.
This article explains why ALTER TABLE statements can become blocked by MySQL’s metadata locking, describes the underlying mechanisms, outlines common scenarios that cause “Waiting for table metadata lock,” and offers practical steps to diagnose and avoid such lock contention.