Tag

database consistency

0 views collected around this technical thread.

Lobster Programming
Lobster Programming
Apr 10, 2025 · Databases

Why Does MySQL Use Two-Phase Commit? Understanding Redo Log and Binlog Coordination

MySQL employs a two‑phase commit to synchronize InnoDB’s redo log with the server’s binlog, ensuring atomicity during transaction commits and preventing data inconsistencies during crash recovery or replication, while also introducing lock contention, extra I/O, and potential blocking.

MySQLTransactionTwo-Phase Commit
0 likes · 5 min read
Why Does MySQL Use Two-Phase Commit? Understanding Redo Log and Binlog Coordination
Architect
Architect
Apr 3, 2024 · Databases

Database and Cache Double-Write Consistency: Common Solutions and Best Practices

This article examines the data consistency challenges of writing to both databases and caches, outlines four common double‑write strategies, analyzes their pitfalls—especially under high concurrency—and recommends the optimal approach of writing to the database then deleting the cache, while discussing retry mechanisms, scheduled tasks, message queues, and binlog listeners.

CacheMessage Queuedatabase consistency
0 likes · 15 min read
Database and Cache Double-Write Consistency: Common Solutions and Best Practices
php中文网 Courses
php中文网 Courses
Jul 26, 2023 · Databases

Understanding MySQL Doublewrite Buffer: Principles, Enabling, and Performance Optimization

This article explains MySQL's doublewrite buffer mechanism, how it ensures data consistency by writing to a redo log before disk, provides configuration steps to enable it, and outlines performance optimization techniques such as adjusting redo log size, separating log files, and tuning flush settings.

Doublewrite BufferInnoDBMySQL
0 likes · 4 min read
Understanding MySQL Doublewrite Buffer: Principles, Enabling, and Performance Optimization
Efficient Ops
Efficient Ops
May 9, 2023 · Databases

Building a Robust Database Consistency Check Tool for Seamless Migrations

This article examines the challenges of data consistency verification during database migrations, reviews existing tools like pt-table-checksum, sync‑diff‑inspector and gt‑checksum, outlines essential capabilities, and proposes a detailed workflow and future enhancements for a versatile, low‑impact consistency checking solution.

MySQLchecksum toolsdata migration
0 likes · 11 min read
Building a Robust Database Consistency Check Tool for Seamless Migrations
Top Architect
Top Architect
Mar 23, 2023 · Backend Development

Ensuring Consistency Between Cache and Database During Dual Writes

The article examines how to maintain data consistency between caches and databases during dual-write operations, categorizes data into three levels, evaluates four update strategies, and proposes solutions such as delayed double deletion, message‑queue compensation, and binlog‑driven cache synchronization.

CacheMessage QueueMySQL
0 likes · 8 min read
Ensuring Consistency Between Cache and Database During Dual Writes
Laravel Tech Community
Laravel Tech Community
Jan 10, 2023 · Backend Development

How to Ensure Data Consistency When Writing to Cache and Database Simultaneously

The article analyzes three data‑level classifications, examines four cache‑database write strategies, discusses their pros and cons, and presents practical solutions such as delayed double deletion, message‑queue compensation, and binlog‑driven cache updates to maintain consistency.

Cache InvalidationMessage Queuecaching
0 likes · 8 min read
How to Ensure Data Consistency When Writing to Cache and Database Simultaneously
Sanyou's Java Diary
Sanyou's Java Diary
Oct 8, 2022 · Backend Development

How to Keep Cache and Database Consistent: Strategies, Pitfalls, and Best Practices

This article explains why cache‑database consistency is a classic challenge, compares common update‑then‑delete patterns, analyzes concurrency and master‑slave delay issues, and recommends reliable solutions such as asynchronous retries with message queues or binlog subscription to achieve eventual consistency.

Message QueueRedisasynchronous retry
0 likes · 18 min read
How to Keep Cache and Database Consistent: Strategies, Pitfalls, and Best Practices
Aikesheng Open Source Community
Aikesheng Open Source Community
Aug 25, 2022 · Databases

Understanding Data Consistency in MySQL Semi‑Synchronous Replication and HA Failover

This article explains the principles of MySQL semi‑synchronous replication, analyzes how data consistency is maintained during high‑availability failover, presents detailed step‑by‑step transaction flow, discusses scenarios causing GTID divergence, and offers testing methods and remediation techniques for DBA practitioners.

DBAGTIDHigh Availability
0 likes · 14 min read
Understanding Data Consistency in MySQL Semi‑Synchronous Replication and HA Failover
Baidu Geek Talk
Baidu Geek Talk
May 11, 2022 · Backend Development

Distributed Transactions: Concepts, TCC and Saga Patterns, and Practical Implementation

The article explains how micro‑service architectures create data‑consistency challenges that require distributed transaction strategies, compares strong‑consistency protocols like 2PC/3PC with eventual‑consistency approaches such as TCC and Saga patterns, and discusses their trade‑offs, implementation complexity, and suitability for real‑world scenarios like a points‑based sign‑in system.

Sagadatabase consistencydistributed transactions
0 likes · 11 min read
Distributed Transactions: Concepts, TCC and Saga Patterns, and Practical Implementation
Top Architect
Top Architect
Apr 20, 2022 · Databases

Understanding Distributed Transactions, Consistency Models, and Sharding in Database Systems

This article explains the fundamentals of distributed transactions, the ACID properties, various consistency models (strong, weak, eventual), sharding strategies (vertical and horizontal), the CAP and BASE theories, and the practical implementations of two‑phase, three‑phase, and TCC commit protocols, highlighting their advantages and drawbacks.

2PC3PCBASE
0 likes · 22 min read
Understanding Distributed Transactions, Consistency Models, and Sharding in Database Systems
IT Architects Alliance
IT Architects Alliance
Feb 20, 2022 · Backend Development

Cache Consistency Strategies for Database and Redis: Tiered Storage and Synchronization Techniques

The article examines tiered data storage and evaluates four cache‑synchronization strategies—updating the database before the cache, deleting the cache before updating the database, updating the cache before the database, and deleting the cache after a database update—highlighting their trade‑offs and practical solutions such as delayed double deletion, message‑queue retries, and binlog‑driven cache updates.

Message QueueMySQLRedis
0 likes · 8 min read
Cache Consistency Strategies for Database and Redis: Tiered Storage and Synchronization Techniques
Top Architect
Top Architect
Jan 24, 2022 · Backend Development

Ensuring Data Consistency Between Cache and Database in Double‑Write Scenarios

The article analyzes the challenges of maintaining data consistency when using both cache (local memory or Redis) and a database, classifies data by real‑time requirements, evaluates four double‑write strategies, and proposes practical solutions such as delayed double deletion, message‑queue compensation, and binlog‑driven cache updates.

CacheData SynchronizationDouble Write
0 likes · 8 min read
Ensuring Data Consistency Between Cache and Database in Double‑Write Scenarios
Architects Research Society
Architects Research Society
Dec 12, 2021 · Databases

Understanding Eventual Consistency and Anti‑Entropy in Distributed Databases – Part 2

This article explains the concept of anti‑entropy as a key mechanism for achieving eventual consistency in distributed database systems, illustrates how XDB Enterprise handles node failures and data drift, and shows practical examples of repairing inconsistencies using the AE service.

XDB Enterpriseanti-entropydata replication
0 likes · 10 min read
Understanding Eventual Consistency and Anti‑Entropy in Distributed Databases – Part 2
DataFunSummit
DataFunSummit
Nov 22, 2021 · Databases

Rigid Transactions: Two-Phase Commit (2PC) and Three-Phase Commit (3PC) Explained

This article explains rigid (strong consistency) distributed transactions, detailing the XA protocol and the classic two‑phase commit (2PC) and three‑phase commit (3PC) mechanisms, their workflows, advantages, limitations, and practical considerations for database systems.

Two-Phase CommitXA protocoldatabase consistency
0 likes · 15 min read
Rigid Transactions: Two-Phase Commit (2PC) and Three-Phase Commit (3PC) Explained
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Oct 21, 2021 · Backend Development

Ensuring Cache and Database Consistency: Strategies and Best Practices

This article explains why cache‑database consistency is a classic problem, analyzes various update‑order and deletion strategies, discusses concurrency and replication delays, and recommends using the "update database then delete cache" approach combined with asynchronous retries via message queues or binlog subscription to achieve reliable eventual consistency.

CacheMessage QueueRedis
0 likes · 23 min read
Ensuring Cache and Database Consistency: Strategies and Best Practices
Architect
Architect
Sep 14, 2021 · Fundamentals

Understanding Distributed Transactions: From Local ACID to CAP Theory and Message‑Queue Solutions

The article uses a personal bank‑transfer incident to introduce local transaction concepts, explains the CAP theorem, examines the challenges of distributed transactions, and presents a message‑queue‑based design with transaction logs and compensation mechanisms to ensure consistency and idempotency.

CAP theoremMessage QueueTransactions
0 likes · 15 min read
Understanding Distributed Transactions: From Local ACID to CAP Theory and Message‑Queue Solutions
IT Architects Alliance
IT Architects Alliance
Jul 11, 2021 · Backend Development

Understanding Distributed Transactions: Two‑Phase Commit, Message‑Queue Solutions, and RocketMQ Transactional Messaging

This article explains how to guarantee data consistency when updating multiple tables or services by using local transactions for single‑node systems, two‑phase commit for distributed databases, and reliable message‑queue patterns—including RocketMQ transactional messages—to achieve eventual consistency and handle duplicate delivery.

Message QueueTransactional MessagingTwo-Phase Commit
0 likes · 21 min read
Understanding Distributed Transactions: Two‑Phase Commit, Message‑Queue Solutions, and RocketMQ Transactional Messaging
Tencent Architect
Tencent Architect
Apr 9, 2021 · Databases

Analysis of Inconsistencies in MySQL Slave Crash Recovery and Sync Master/Relay Log Info

This article analyzes how MySQL slave crashes can cause inconsistencies between master info and relay log positions during sync_master_info and sync_relay_log_info processes, presents case studies of duplicated events, explains the impact of different storage repositories (FILE vs TABLE), and recommends configuration settings to achieve server‑crash‑safe replication.

MySQLRelay LogReplication
0 likes · 15 min read
Analysis of Inconsistencies in MySQL Slave Crash Recovery and Sync Master/Relay Log Info
Selected Java Interview Questions
Selected Java Interview Questions
Oct 30, 2019 · Backend Development

Common Cache Problems and Their Solutions: Avalanche, Penetration, Concurrency, and DB‑Cache Inconsistency

This article explains typical cache issues such as cache avalanche, cache penetration, concurrent write conflicts, and database‑cache write inconsistency, and provides practical mitigation strategies including high‑availability setups, circuit breakers, placeholder values, distributed locks, double‑delete, and cache‑aside patterns.

CacheCache AvalancheCache Penetration
0 likes · 8 min read
Common Cache Problems and Their Solutions: Avalanche, Penetration, Concurrency, and DB‑Cache Inconsistency
Architecture Digest
Architecture Digest
Nov 8, 2016 · Backend Development

Why Replace Distributed Transactions? A Message Queue and State‑Table Solution

The article explains the drawbacks of traditional two‑phase commit distributed transactions—reduced availability, performance, and scalability—and proposes a message‑queue‑plus‑state‑table pattern with idempotent processing to achieve eventual consistency while improving system throughput.

Message QueueTwo-Phase Commitbackend architecture
0 likes · 7 min read
Why Replace Distributed Transactions? A Message Queue and State‑Table Solution