MySQL 8.2 adds native read/write separation using MySQL Router 8.2 with InnoDB ReplicaSet, automatically routing SELECT queries to replicas and writes to the primary without application changes, with transaction-aware routing and configurable access modes.
This article provides a comprehensive practical guide to MySQL master-slave replication, covering synchronization principles, three replication modes, delay causes and troubleshooting, read-write splitting implementation with common pitfalls, failover strategies, and five production pitfalls to avoid.
Database High AvailabilityDatabase ReplicationFailover
This guide walks through the complete process of designing, configuring, and operating a PostgreSQL primary‑standby setup with streaming replication, choosing between asynchronous and synchronous modes, implementing read‑write splitting via application routing or PgBouncer, and handling monitoring, failover, and common pitfalls for production‑grade high availability.
A production-ready guide to integrating Spring Boot 3.x with ShardingSphere 5.5.0, covering sharding algorithms (hash, range, time-based), global ID generation (Snowflake, segment mode), read-write splitting consistency traps, cross-shard query optimization, connection pool tuning, and a deployment checklist.
Connection PoolCross-Shard QueriesGlobal ID Generation
The article explains why a single MySQL server eventually hits read, write, or availability limits, outlines a step‑by‑step evolution—from SQL tuning and caching to read‑write splitting, high‑availability setups, and finally vertical or horizontal sharding—while warning against premature distribution.
The article walks through a real‑world order system that spikes to 300,000 QPS, explaining why the original single‑node MySQL design fails, and detailing a step‑by‑step evolution—index tuning, transaction fixes, read‑write splitting, vertical and horizontal sharding, plus data‑pipeline integration—to achieve stable low latency at massive scale.
In high‑concurrency internet architectures, a MySQL master‑slave setup with read‑write splitting is the baseline for high availability, but static routing suffers from node failures and lag; this article explains how ShardingSphere provides health checks, auto‑failover, load‑balancing, and degradation to achieve resilient read‑write separation.
This article presents five advanced Spring Boot 3.5.0 patterns—ETag with conditional requests, read‑write separation, virtual threads, HTTP client connection reuse, and asynchronous processing—to achieve sub‑millisecond API response times, complete with code examples, configuration steps, and performance benefits.
The article explains why simple SQL routing is insufficient for MySQL read‑write separation, details replication mechanisms, consistency challenges, and presents a comprehensive upgrade path—including static, dynamic, middleware, and hybrid routing strategies, configuration guidelines, monitoring, and high‑availability practices—to build a production‑grade, high‑concurrency architecture.
MySQL Router 8.2 now supports automatic read/write splitting for InnoDB ReplicaSet clusters, allowing reads to be routed to replicas and writes to the primary without any changes to application code, as demonstrated through configuration steps, connection examples, and practical observations.
Discover how to set up MySQL InnoDB ReplicaSet and configure MySQL Router 8.2 for automatic read/write splitting, enabling reads to be routed to replicas and writes to the primary without code changes, complete with step-by-step commands, configuration snippets, and visual verification.
MySQL 8.2 introduces native read/write splitting via MySQL Router, allowing automatic routing of reads to replicas and writes to the primary source; this guide shows how to set up a simple InnoDB ReplicaSet, configure Router, verify traffic flow, and leverage access mode commands for fine‑grained control.
By configuring master‑slave replication, implementing read‑write splitting with ProxySQL, and selecting appropriate load‑balancing strategies, you can significantly improve MySQL’s scalability and availability while addressing replication lag through parallel or semi‑synchronous replication, hardware tuning, and monitoring.
High AvailabilityLoad BalancingMaster-Slave Replication
This article explains why basic Spring Boot datasource settings are insufficient for production and walks through five advanced configurations—HikariCP tuning, transaction timeout and isolation, read‑write splitting, slow‑SQL monitoring, and security hardening—each illustrated with concrete code snippets and rationale.
This guide demonstrates how MySQL Router 8.2 can automatically route read and write traffic using an InnoDB ReplicaSet, showing the minimal architecture, configuration steps, command examples, and the resulting read‑write split behavior without requiring application changes.
This article demonstrates how MySQL Router 8.2 can automatically route read traffic to replica instances and write traffic to the primary instance in an InnoDB ReplicaSet, providing configuration steps, command examples, and observed behavior without requiring any changes to the application.
This article walks through a real e‑commerce MySQL performance crisis, showing how to pinpoint bottlenecks, analyze slow‑query logs, use EXPLAIN, add composite indexes, rewrite SQL, apply partitioning, read/write splitting and caching, and achieve sub‑second response times with 99% CPU reduction.
This tutorial walks you through configuring Spring Boot 3.5.5 with ShardingSphere‑JDBC 5.5.2 to achieve database sharding, read‑write splitting, connection‑pool optimization using Druid, and demonstrates the complete code for entities, mappers, services, and controllers, plus verification steps.
MySQL 8.2 introduces native read/write splitting via MySQL Router, allowing automatic routing of reads to replicas and writes to the primary in an InnoDB ReplicaSet without any application changes.
This article explains why interviewers probe sharding, walks through the typical chain of questions, compares partition tables and read/write splitting, shows how to decide between sharding strategies, estimate capacity, plan expansion, and safely migrate data with traffic replication.
This guide walks senior backend engineers through the strategic reasoning, capacity estimation, and step‑by‑step migration techniques for sharding databases, covering when to split, choosing between partitioning, read/write splitting, or full sharding, and how to plan safe expansions.
This guide walks through practical techniques to push MySQL performance from a few thousand to tens of millions of queries per second, covering single‑node tuning, read/write splitting, caching layers, and horizontal/vertical sharding with concrete configuration tips and architecture diagrams.
This article dissects a production‑grade Go database access framework for microservices, covering unified interface abstraction, factory pattern for multi‑DB support, PostgreSQL array handling, read‑write splitting with load balancing, Redis cache protection, monitoring, and deployment considerations, with full code examples and open‑source links.
This article explains MySQL master‑slave replication, why read/write splitting is essential, four practical read‑distribution strategies, the main causes of replication lag, four solutions for write‑after‑read consistency, multi‑slave allocation methods, replication modes, and a real‑world e‑commerce decision matrix, ending with a golden architecture recommendation.
This article explains why read‑write separation is essential for high‑concurrency applications, discusses its limitations, and provides a step‑by‑step Spring Boot implementation—including datasource configuration, routing logic, context management, custom annotations, AOP handling, and usage examples—complete with code snippets and diagrams.
This article walks through why a single MySQL instance often fails under load, explains the fundamentals of asynchronous master‑slave replication and read‑write splitting, provides step‑by‑step configuration scripts, highlights common pitfalls with solutions, and shows advanced optimization and monitoring techniques for building a scalable, high‑availability MySQL architecture.
This guide shows how to combine MyBatis-Plus dynamic data source routing with ShardingSphere-JDBC for horizontal sharding and read‑write splitting, including Maven dependencies, YAML configuration, Spring bean setup, and a custom load‑balancing algorithm to keep @DS annotations functional.
This article explains how to implement database read‑write separation in a Spring Boot application by configuring master and slave data sources, creating a routing datasource, managing thread‑local context, and using an AOP‑based annotation to switch between read and write operations.
This guide demonstrates how to set up Docker‑based MySQL instances, configure ShardingSphere‑Proxy for database sharding and read‑write splitting, and integrate ShardingSphere‑JDBC with SpringBoot 2.x using YAML configurations and Maven dependencies, providing complete code snippets and default connection details.
This article systematically examines MySQL optimization techniques for both read‑many/write‑few and write‑many/read‑few business scenarios, covering architecture design, caching, sharding, asynchronous processing, monitoring, and emerging NewSQL/HTAP solutions to achieve high performance, consistency, and scalability.
MySQL Router 8.2 now supports automatic read/write splitting for InnoDB ReplicaSets, allowing reads to be routed to replicas and writes to the primary without any application changes, thereby improving performance and scalability.
This article explains how MySQL Router 8.2 enables automatic read/write splitting for InnoDB ReplicaSet deployments, showing configuration steps, code examples, and the benefits of directing reads to replicas and writes to the primary without modifying application code.
This article introduces ShardingJDBC, a Java middleware that simplifies sharding, read/write separation, and distributed transactions, and provides a step‑by‑step Spring Boot example with configuration, code snippets, and verification of its core features.
This article demonstrates how MySQL Router 8.2 can perform automatic read/write splitting using an InnoDB ReplicaSet, shows the required configuration, explains the behavior of read and write connections, and concludes with the benefits of the feature while also containing promotional material for unrelated services.
This article shares a practical case study on how a coupon‑distribution system evolved from a single‑table design to a sharded, multi‑database architecture with query optimization, ElasticSearch integration, and read/write splitting to handle growing data volume, complex queries, and increasing request traffic.
This article explains the essential elements of high‑concurrency system design—performance, availability, scalability—introduces quantitative metrics, classifies read‑heavy and write‑heavy scenarios, and details practical solutions such as database read/write separation, local and distributed caching, cache‑penetration and avalanche mitigation, and CQRS implementation for billion‑user applications.
This article explains how to set up read/write database separation in Laravel by configuring multiple database connections in the config/database.php file, covering both identical and distinct credentials for read and write servers, and describing the purpose of the sticky option to ensure data consistency during a request.
This guide walks through creating a three‑node MySQL environment, installing and configuring MariaDB, establishing master‑slave replication, and implementing read/write splitting on an application server using MySQL‑Proxy, complete with command‑line examples and configuration snippets.
This article explains why read‑heavy internet services use MySQL master‑slave replication for read/write separation, describes the asynchronous replication process, discusses latency side‑effects, and offers practical strategies such as data redundancy, caching, and direct master queries to mitigate delays.
This article provides a comprehensive, step‑by‑step tutorial on using Apache ShardingSphere and Sharding‑JDBC to implement horizontal, vertical, and broadcast sharding, covering core concepts, sharding strategies, configuration examples, and practical code snippets for real‑world database partitioning.
This article explains what database middleware is, why it’s needed for scaling large data workloads, and provides detailed overviews of six popular middleware solutions—including MyCat, MySQL‑Proxy, DRDS, Atlas, Zebra, and ShardingSphere—highlighting their key features and use cases.
Oracle’s MySQL 8.2 introduces built‑in read/write splitting via MySQL Router, allowing write traffic to target primary instances while reads are automatically routed to secondary replicas, with configuration examples, command‑line bootstrap, routing settings, and practical observations on transaction behavior.
This article recounts the step‑by‑step evolution of a ride‑hailing order service’s data layer—from a single SQLServer database through SQL optimization, read‑write splitting, business‑domain sharding, caching and MQ integration, to a custom sharding component and smooth migration to MySQL—highlighting challenges, solutions, and lessons learned.
This article explains the reasons for read/write splitting, compares direct‑client and proxy‑based master‑slave setups, and presents five practical strategies—including forcing reads to the master, sleep delays, lag checks, master‑position waiting, and GTID waiting—to mitigate stale reads caused by MySQL replication lag.
This article introduces Robustdb, a compact Java library that implements client‑side read‑write splitting and method‑level routing for MySQL databases, explains its architecture, core code components, dynamic read‑pool allocation strategy, and performance comparison with Atlas, while providing practical implementation details and configuration guidance.
This guide demonstrates how to implement a one‑write‑multiple‑read data source strategy in Spring Boot 2.2 using AOP, configurable pointcuts, custom routing, load‑balancing algorithms, and a reusable starter that can be packaged as a Maven jar.
The DBLE 3.23.04.0 release introduces six new or refactored features, fixes over five critical community issues and more than a hundred bugs, adjusts TCP keep‑alive parameters, adds experimental configuration support, and provides detailed LTS version updates and incompatibility notes for users.
This article introduces Robustdb, a compact open‑source read‑write separation framework built with about ten classes and two thousand lines of code, explains its architecture, routing logic, method‑level transaction handling, dynamic data‑source management, and performance advantages over existing solutions like Atlas.
This article introduces ProxySQL as a high‑performance MySQL proxy, explains its request flow, multi‑layer configuration system, key tables, and demonstrates practical scenarios such as read‑write splitting, hostgroup weight tuning, replication‑lag handling, blacklist/whitelist rules, and firewall protection.
This guide walks through the background of MySQL read/write splitting, records troubleshooting steps for an unexpected slave crash, explains the two splitting models, and provides detailed commands and configuration examples for using Keepalived to ensure high availability of the slave node.
This article documents a MySQL read‑write splitting architecture, investigates an unexpected slave‑node crash, and provides a step‑by‑step guide to using Keepalived for monitoring and automatically restarting the MySQL container to achieve high availability of the replica.
This article chronicles the step‑by‑step evolution of a ride‑hailing order service's data layer, covering the shift from a single SQLServer database to read‑write separation, business‑domain sharding, caching, message queues, a self‑built sharding component, and a data exchange platform for smooth migration and ongoing scalability.
MySQL Migrationdatabase shardingdistributed architecture
This article walks through turning a basic personal‑blog architecture—single server, MySQL, and Node.js—into a high‑concurrency system by adding Redis caching, Nginx load balancing, horizontal scaling, read‑write splitting, sharding, NewSQL databases, and message‑queue techniques.
This article explains how to transform a simple personal‑blog backend into a high‑performance, horizontally scalable system by introducing caching with Redis, load balancing with Nginx/LVS, read/write separation, database sharding, and modern NewSQL solutions such as TiDB, while also discussing related challenges like cache consistency and data migration.
This article introduces Robustdb, a lightweight client‑side read‑write splitting framework built with only a dozen classes, explains its architecture, routing logic, method‑level transaction handling, dynamic data‑source management, and presents performance comparisons with the legacy Atlas proxy.
This article explains when read/write splitting is needed, details MySQL master‑slave replication mechanics, outlines middleware design choices, and provides practical monitoring and mitigation strategies for replication lag, helping developers decide and implement effective database scaling.
This article explains how to achieve database read‑write separation in high‑concurrency Java applications by configuring master and slave data sources, implementing a routing DataSource, managing context with ThreadLocal, defining a custom @DataSourceSwitcher annotation, and applying AOP to switch between read and write operations.
This article explains how a company built Robustdb, a lightweight client‑side read/write splitting solution to replace Atlas, detailing its background, routing core, method‑level control, dynamic data source management, performance gains, and providing code examples for implementation.
This article explains how to set up MySQL master‑slave replication for read‑write splitting, covering configuration of master and slave servers, binary log usage, troubleshooting common issues, and demonstrates implementing the setup in a Java project using Sharding‑JDBC.
The article introduces the DBLE distributed middleware, outlines the main updates in version 3.22.07.0—including read‑write splitting local read, OpenSSL support, hint‑based query plan improvements—and provides the complete release notes, bug fixes, acknowledgments, and related learning resources.
This article explains the concept of database read‑write splitting, discusses its limitations, and provides a step‑by‑step guide with Spring Boot code to configure master‑slave data sources, implement dynamic routing, context handling, custom annotations, and AOP for seamless switching.
This tutorial walks through the complete process of configuring MySQL master‑slave replication, preparing Docker containers, configuring MyBatisPlus and ShardingSphereJDBC for read‑write splitting, building a Spring Boot project with the necessary dependencies, generating code, and testing the setup with sample controller endpoints.
This tutorial explains how to configure MySQL master‑slave replication using Docker, set up read‑write splitting with ShardingSphereJDBC, integrate MyBatis‑Plus, and build a Spring Boot application that demonstrates write operations on the master and read operations on the slave.
This tutorial walks through setting up MySQL master‑slave replication using Docker, configuring ShardingSphereJDBC for read‑write splitting, and integrating it into a Spring Boot project with MyBatis‑Plus, covering environment preparation, core theory, detailed configuration, and testing procedures.
This article explains the concept, benefits, and step‑by‑step configuration of non‑intrusive read‑write splitting for MySQL databases using MSE and OpenSergo, including practical examples, YAML rules, and SQL insight for improved stability and performance.
This article analyzes why MySQL connections become invalid when using Druid with ReplicationConnection for read/write splitting, explains the underlying proxy mechanics, and presents a practical solution by extending MySqlValidConnectionChecker to correctly validate both master and slave connections.
To support the rapidly growing DeWu App, the team created Rainbow Bridge—a ShardingSphere‑based middleware that unifies horizontal sharding, read‑write separation, shadow‑DB routing, rate limiting, and active‑active traffic correction, while adding a graphical console, stability enhancements, fine‑grained observability, hybrid JDBC/Proxy switching, and ongoing open‑source contributions.
Data ShardingDatabase MiddlewarePerformance Optimization
This article outlines a systematic approach for backend engineers to identify root causes of database slowness and presents eight concrete optimization techniques—ranging from data reduction and space‑for‑performance trade‑offs to appropriate storage system selection—while explaining when each method is most effective and what trade‑offs to consider.
This article explores common e‑commerce backend challenges such as duplicate orders, order snapshots, cart storage, inventory oversell, logistics updates, account balance consistency, read‑write splitting, hot‑cold data separation, and sharding, and provides concrete design patterns and SQL examples to solve them.
This article explains MySQL master‑slave replication fundamentals, why it’s used, the replication workflow, causes of lag, and presents multiple practical solutions—including system tuning, partitioning, caching, multi‑threaded relay log replay, and read‑from‑master strategies—to improve performance and reliability.
This guide explains the concepts, benefits, and step‑by‑step configuration of MySQL master‑slave replication and read/write splitting, including required master and slave settings, practical VM setup, and Mycat configuration files for routing reads and writes.
Database High AvailabilityMaster-Slave ReplicationMySQL
This article provides a step‑by‑step tutorial on configuring MySQL master‑slave replication using Docker, explains redo log and binlog mechanisms, and demonstrates how to implement Sharding‑JDBC read/write splitting and database sharding with Spring Boot, including code examples and configuration details.
This tutorial explains how to implement read/write splitting in Spring Boot by configuring multiple data sources, creating a custom AbstractRoutingDataSource, and using AOP to dynamically route queries to master or slave databases based on method patterns and annotations.
This article explains how to implement read/write separation in a Spring Boot application by configuring multiple data sources, creating a custom AbstractRoutingDataSource, using AOP to switch between master and slave databases, and demonstrates the setup with Maven, MyBatis, and JUnit tests.
This article explains how to achieve read‑write splitting in a Spring Boot application by configuring multiple data sources, creating a custom AbstractRoutingDataSource, managing routing keys with ThreadLocal, and using AOP to automatically switch between master and slave databases for different CRUD operations.
This article provides a detailed walkthrough of ShardingSphere‑Jdbc read/write splitting, MySQL master‑slave replication setup with Docker, the differences between redo log and binlog, two‑phase commit, and practical sharding configurations using inline strategies and distributed primary keys in a Spring Boot project.
This article explains the basic principles of MySQL master‑slave architecture, the role of read‑only replicas, loop‑replication problems, master‑slave delay measurement, various failover strategies, parallel replication mechanisms across MySQL versions and MariaDB, GTID usage, and read‑write splitting techniques, providing practical commands and diagrams for each concept.
The article outlines a range of techniques—including caching, read‑write splitting, vertical partitioning, sharding, cold‑hot data separation, Elasticsearch, NoSQL and NewSQL—to store and retrieve billions of user‑generated records efficiently while maintaining high throughput and low latency.
This article explains why MySQL queries become slow, explores index-related pitfalls and optimization techniques, and then compares ElasticSearch and HBase as complementary solutions for large‑scale data and search scenarios, offering practical tips and code examples.
This article explains how to implement read‑write separation in Spring Boot by extending AbstractRoutingDataSource, using ThreadLocal for key storage, and creating AOP aspects that prioritize datasource switching over transaction management.
This article explains why MySQL queries become slow, how indexes work and fail, the impact of MDL locks, large‑table challenges, sharding and read‑write splitting strategies, then introduces Elasticsearch’s search capabilities and HBase’s column‑family storage, offering practical guidance for each technology.
This article analyzes common causes of slow MySQL queries such as index misuse, MDL locks, and large‑table bottlenecks, then presents practical solutions like proper indexing, sharding, read/write splitting, and evaluates when to complement MySQL with ElasticSearch or HBase for better performance.
This article introduces the DBLE MySQL‑compatible distributed middleware, details its new pure read/write splitting feature in version 3.20.10.0, and provides a comprehensive table showing which SQL statements trigger implicit commits and their support status.
This article explains how to achieve database read‑write separation in a Spring application by using AbstractRoutingDataSource for routing, ThreadLocal for context, AOP interceptors for automatic switching, and provides a complete example with configuration, service code, and test cases.
This article explains the concept, advantages, and inner workings of master‑slave database replication, outlines the key threads and step‑by‑step process, and provides common interview questions with concise answers for candidates preparing for database engineering roles.
This article explains why growing MySQL workloads require moving from a single instance to a clustered architecture, details the mechanics of master‑slave replication, asynchronous, semi‑synchronous and group replication, and evaluates various high‑availability solutions and read‑write splitting techniques.
This article explains how to implement database read‑write splitting in a Spring Boot application by configuring master and slave data sources, creating a dynamic routing datasource, using a ThreadLocal context holder, defining a custom annotation with AOP for automatic switching, and demonstrates usage with sample code.
This article explains how to achieve database read‑write separation in high‑concurrency Java applications by configuring master‑slave data sources, implementing a routing data source, managing context with ThreadLocal, defining a custom @DataSourceSwitcher annotation, and applying AOP to dynamically switch between read and write databases.
This article introduces Apache ShardingSphere's architecture—including ShardingSphere‑JDBC, ShardingSphere‑Proxy, and the upcoming Sidecar—explains data sharding principles, read/write splitting, and provides a complete Spring Boot example with Maven dependencies, Java source code, and configuration files for horizontal database partitioning.
The article explains how ThinkPHP’s query method works with raw SQL, distinguishes between execute for writes and query for reads, details MySQL master‑slave replication considerations, and describes the framework’s database connection initialization, including read/write separation logic and related code examples.
This article demonstrates how to implement read/write splitting in a Spring Boot application by configuring multiple data sources, using AbstractRoutingDataSource for dynamic routing, and applying AOP and custom annotations to direct read operations to slave databases and write operations to the master, with full Maven and MyBatis setup.
This guide explains how to replace the traditional MHA/Keepalived high‑availability setup with MariaDB MaxScale integrated with Consul, providing a simpler, fully automated HA solution, complete with configuration files, installation commands, and detailed failover, switchover, and rejoin procedures.
This article explains the principles of MySQL performance optimization, distinguishes active and passive approaches, and provides concrete solutions for slow single queries, partially slow queries, and overall slow queries through proper indexing, data partitioning, slow‑query‑log configuration, and read‑write splitting.
This guide explains how to configure Laravel for read/write database separation and set up Nginx load balancing, covering hardware requirements, Laravel config/database.php adjustments, Nginx upstream strategies, detailed server blocks, and essential parameter explanations for a scalable web architecture.
This article demonstrates how to achieve read‑write splitting in a Spring Boot application by configuring multiple data sources, creating a custom AbstractRoutingDataSource, using AOP to switch between master and slave databases, and integrating the routing data source with MyBatis for transparent database operations.
This article demonstrates how to implement database read‑write splitting in a Spring Boot application by configuring multiple MySQL data sources, creating a custom AbstractRoutingDataSource, using ThreadLocal routing keys, and applying AOP to switch between master and slave databases for CRUD operations.
This article surveys several MySQL middleware solutions—including Atlas, MySQL Router, Mycat, Cobar, Amoeba, and client‑side sharding—detailing their architectures, key features, advantages, and practical recommendations for production use.
The article outlines eight practical techniques—including caching, page staticization, database optimization, hot‑data separation, operation merging, read‑write splitting, distributed databases, and the use of NoSQL and Hadoop—to efficiently store and serve massive data volumes in large‑scale internet services.
The article presents a detailed interview with Yan Huqing, the lead of the open‑source DBLE project, covering his background, the upcoming Shanghai 3306π meetup agenda, and practical advice on using Dble for sharding, read‑write splitting, and advanced monitoring in distributed database environments.