Tagged articles
26 articles
Page 1 of 1
Java Companion
Java Companion
Feb 5, 2026 · Backend Development

Elegant Dynamic Data Source Switching in SpringBoot Using ThreadLocal and AbstractRoutingDataSource

This article walks through building an elegant dynamic data‑source switch in SpringBoot by combining ThreadLocal with AbstractRoutingDataSource, covering the context holder, custom routing class, YAML configuration, testing, annotation‑driven switching, and runtime addition of new data sources.

Runtime DataSource RegistrationSpringBootThreadLocal
0 likes · 16 min read
Elegant Dynamic Data Source Switching in SpringBoot Using ThreadLocal and AbstractRoutingDataSource
Ray's Galactic Tech
Ray's Galactic Tech
Sep 24, 2025 · Backend Development

How to Set Up Multi-DataSource in Spring Boot with MyBatis

This guide walks through two approaches for configuring multiple databases in a Spring Boot and MyBatis project—native multi‑data‑source beans and the dynamic‑datasource‑spring‑boot‑starter—covering project structure, Maven dependencies, Java configuration, mapper setup, usage examples, common pitfalls, and a concise summary of when to choose each method.

JavaMulti-DataSourceMyBatis
0 likes · 9 min read
How to Set Up Multi-DataSource in Spring Boot with MyBatis
Cognitive Technology Team
Cognitive Technology Team
Jul 16, 2025 · Databases

Mastering Dynamic Multi‑DataSource Management in Spring Boot: A Deep Dive

Dynamic‑datasource 4.3.1 offers a powerful AOP‑based, annotation‑driven solution for seamless multi‑database routing, read‑write separation, and load‑balancing in Spring Boot applications, while addressing common pitfalls such as transaction boundaries, connection‑pool configuration, health‑check failures, and version compatibility.

Multi-DataSourcedynamic-datasourcehealth check
0 likes · 18 min read
Mastering Dynamic Multi‑DataSource Management in Spring Boot: A Deep Dive
Java Captain
Java Captain
May 2, 2025 · Databases

Implementing Dynamic MySQL Master‑Slave Switching in SpringBoot Using AOP and Custom Annotations

This article demonstrates how to use SpringBoot 3.0.4 with AOP and a custom @DataSource annotation to dynamically switch between MySQL master and slave databases, ensuring high availability by automatically falling back to the master when a slave fails, and provides configuration and code examples for multiple data sources.

Database SwitchingSpringBootaop
0 likes · 14 min read
Implementing Dynamic MySQL Master‑Slave Switching in SpringBoot Using AOP and Custom Annotations
Java Architect Essentials
Java Architect Essentials
Apr 10, 2025 · Backend Development

Master Dynamic Data Source Switching in SpringBoot: A Step‑by‑Step Guide

This article walks through the complete process of implementing dynamic data source switching in a SpringBoot application, covering the core concepts of thread‑local context, abstract routing, custom annotations with AOP, configuration, code examples, and important considerations such as transaction management and performance.

JavaSpringBootThreadLocal
0 likes · 6 min read
Master Dynamic Data Source Switching in SpringBoot: A Step‑by‑Step Guide
Java Captain
Java Captain
Apr 9, 2025 · Backend Development

Implementing Dynamic MySQL Master‑Slave Data Source Switching in SpringBoot with AOP and Custom Annotations

This tutorial explains how to use SpringBoot, AOP, and a custom @DataSource annotation to dynamically switch between MySQL master and slave databases—covering configuration, code implementation, multiple slave handling, and an Oracle example—to ensure high availability and flexible data source management.

JavaMaster‑SlaveMulti-DataSource
0 likes · 13 min read
Implementing Dynamic MySQL Master‑Slave Data Source Switching in SpringBoot with AOP and Custom Annotations
Architect
Architect
Mar 12, 2025 · Backend Development

DataSource Switching in Spring Boot with ThreadLocal & AbstractRoutingDataSource

Facing the need to query multiple databases in a Spring Boot application, this guide walks through building a custom dynamic datasource solution using ThreadLocal and AbstractRoutingDataSource, covering core implementations, annotation‑based switching, dynamic datasource addition, configuration, and comprehensive test results.

JavaSpring BootThreadLocal
0 likes · 18 min read
DataSource Switching in Spring Boot with ThreadLocal & AbstractRoutingDataSource
Top Architecture Tech Stack
Top Architecture Tech Stack
Feb 25, 2025 · Backend Development

Implementing Dynamic MySQL Master‑Slave Switching in SpringBoot Using AOP and Custom Annotations

This tutorial explains how to implement dynamic master‑slave MySQL switching in a SpringBoot 3.0.4 project using AOP and a custom @DataSource annotation, covering configuration, enum definitions, utility classes, aspect handling, and usage examples for both single and multiple data sources, including Oracle integration.

JavaSpringBootaop
0 likes · 15 min read
Implementing Dynamic MySQL Master‑Slave Switching in SpringBoot Using AOP and Custom Annotations
Java Backend Technology
Java Backend Technology
Feb 19, 2025 · Backend Development

Mastering Dynamic MySQL Master‑Slave Switching in SpringBoot with AOP

Learn how to implement dynamic MySQL master‑slave switching in a SpringBoot project using AOP and custom annotations, ensuring automatic failover to the master when a slave fails, with detailed configuration, code examples, and guidance for multiple data sources and Oracle integration.

Database FailoverMaster‑SlaveSpringBoot
0 likes · 15 min read
Mastering Dynamic MySQL Master‑Slave Switching in SpringBoot with AOP
Su San Talks Tech
Su San Talks Tech
Dec 28, 2024 · Backend Development

Master Spring Boot Multi‑DataSource Integration with MyBatis

This tutorial explains how to combine Spring Boot, MyBatis, and multiple databases using Druid connection pools, dynamic routing data sources, custom annotations, and AOP, providing complete configuration examples, code snippets, and best‑practice guidance for backend developers.

JavaMulti-DataSourceSpring Boot
0 likes · 17 min read
Master Spring Boot Multi‑DataSource Integration with MyBatis
Java High-Performance Architecture
Java High-Performance Architecture
Apr 8, 2024 · Backend Development

Dynamic Multi-DataSource Switching & Transaction Management in Spring

This article explores solutions for managing multiple data sources in a Spring application, covering dynamic routing with AbstractRoutingDataSource, configuration‑file and database‑table approaches, AOP‑based source switching, and custom multi‑transaction handling to ensure consistency across heterogeneous databases.

JavaMulti-Database Transactionabstractroutingdatasource
0 likes · 15 min read
Dynamic Multi-DataSource Switching & Transaction Management in Spring
IT Xianyu
IT Xianyu
Dec 12, 2023 · Backend Development

Implementing Dynamic Data Source Switching in Spring Boot Using ThreadLocal and AbstractRoutingDataSource

This article explains how to build a custom dynamic data‑source solution for Spring Boot by leveraging ThreadLocal and AbstractRoutingDataSource, provides complete Java code for context holders, routing datasource, configuration, annotation‑driven switching, and runtime addition of new data sources.

BackendThreadLocalabstractroutingdatasource
0 likes · 15 min read
Implementing Dynamic Data Source Switching in Spring Boot Using ThreadLocal and AbstractRoutingDataSource
JD Cloud Developers
JD Cloud Developers
Nov 21, 2023 · Backend Development

Mastering Read‑Write Separation in Spring Boot: A Complete Guide

This guide explains how to implement read‑write separation in Spring Boot applications by configuring master and slave databases, creating dynamic routing data sources, using custom annotations and AOP, integrating HikariCP and MyBatis, and handling thread‑local context for optimal performance.

HikariCPMyBatisRead-Write Separation
0 likes · 10 min read
Mastering Read‑Write Separation in Spring Boot: A Complete Guide
Code Ape Tech Column
Code Ape Tech Column
Apr 7, 2023 · Backend Development

Dynamic Multi-DataSource Management and Transaction Handling in Spring

This article explains how to dynamically manage multiple data sources and ensure transaction consistency across them in Spring applications, covering both configuration‑file and database‑table approaches, custom AOP switching, and a bespoke multi‑database transaction mechanism.

Backend DevelopmentJavadynamic-datasource
0 likes · 14 min read
Dynamic Multi-DataSource Management and Transaction Handling in Spring
Architect's Guide
Architect's Guide
Oct 31, 2022 · Databases

Robustdb: A Client‑Side Read‑Write Splitting Solution for MySQL

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.

Javadatabase routingdynamic-datasource
0 likes · 17 min read
Robustdb: A Client‑Side Read‑Write Splitting Solution for MySQL
Code Ape Tech Column
Code Ape Tech Column
May 18, 2022 · Backend Development

Integrating Spring Boot with MyBatis and Multi‑DataSource (Dynamic DataSource) – A Complete Guide

This article explains how to integrate Spring Boot with MyBatis, configure a single Druid data source, implement multi‑data‑source support using Spring's AbstractRoutingDataSource, create a dynamic data source with ThreadLocal, and wire everything together with custom annotations, aspects, and transaction management for backend Java applications.

BackendMulti-DataSourceMyBatis
0 likes · 18 min read
Integrating Spring Boot with MyBatis and Multi‑DataSource (Dynamic DataSource) – A Complete Guide
ITFLY8 Architecture Home
ITFLY8 Architecture Home
Mar 11, 2020 · Backend Development

How to Build a Multi‑Tenant SaaS Application with Spring Boot and Dynamic Data Sources

This tutorial walks through designing and implementing a Spring Boot‑based SaaS platform that supports multiple tenants by dynamically switching databases or schemas, covering architecture overview, tenant identification, data‑source routing, Maven setup, entity and repository definitions, interceptor configuration, and a simple login test.

HibernateSaaSSpring Boot
0 likes · 27 min read
How to Build a Multi‑Tenant SaaS Application with Spring Boot and Dynamic Data Sources
Programmer DD
Programmer DD
Dec 16, 2019 · Backend Development

Build a Multi‑Tenant SaaS with Spring Boot: Dynamic DataSource & Schema Switching

This tutorial walks through creating a SaaS application with Spring Boot that supports multiple tenants by using independent or shared databases with separate schemas, covering tenant identification, dynamic DataSource routing, Hibernate multi‑tenancy configuration, and a complete code example including Maven setup, entity definitions, interceptors, and a login test.

HibernateJavaSaaS
0 likes · 26 min read
Build a Multi‑Tenant SaaS with Spring Boot: Dynamic DataSource & Schema Switching