Tagged articles
AbstractRoutingDataSource
21 articles · Page 1 of 1
This article explains how to implement multi-tenant architecture using Spring Boot and Spring Cloud, covering database isolation strategies, dynamic data source routing with AbstractRoutingDataSource, tenant management, security configuration, and deployment considerations for SaaS applications.
AbstractRoutingDataSourceEurekaMulti-tenancy
0 likes · 13 min read

This tutorial demonstrates how to implement dynamic data source switching in Spring Boot using ThreadLocal and AbstractRoutingDataSource, covering configuration, annotation-based routing via AOP, and runtime data source registration from a database.
AOPAbstractRoutingDataSourceDataSource Routing
0 likes · 17 min read

This article demonstrates how to implement dynamic data source switching in Spring Boot using ThreadLocal and AbstractRoutingDataSource, covering configuration, annotation-based switching, and runtime data source registration with Druid.
AOPAbstractRoutingDataSourceDruid
0 likes · 18 min read

This article walks through a production-ready Spring Boot multi-tenancy implementation using database-per-tenant isolation, JWT-based tenant identification via Spring Security, AbstractRoutingDataSource for dynamic routing, and ThreadLocal context management, while exposing critical pitfalls in transaction timing, async task propagation, and dynamic tenant registration.
AbstractRoutingDataSourceDatabase Per TenantJWT
0 likes · 16 min read


java1234Feb 6, 2026 · Backend Development
This tutorial shows how to implement graceful dynamic data source switching in SpringBoot by combining ThreadLocal with AbstractRoutingDataSource, configuring master/slave databases, adding a @DS annotation with AOP support, and enabling runtime addition of new data sources.
AOPAbstractRoutingDataSourceJava
0 likes · 17 min read

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.
AOPAbstractRoutingDataSourceMyBatis Plus
0 likes · 16 min read

This tutorial explains how to implement dynamic data source switching in Spring Boot by combining ThreadLocal with AbstractRoutingDataSource, covering custom context holders, configuration, annotation‑driven switching, dynamic addition of data sources, and complete code examples with test results.
AbstractRoutingDataSourceMyBatis PlusThreadLocal
0 likes · 16 min read

This article demonstrates how to build a dynamic data source switching mechanism in Spring Boot by leveraging ThreadLocal for thread‑scoped context and AbstractRoutingDataSource for routing, covering manual implementation, annotation‑driven switching, and runtime addition of new data sources.
AbstractRoutingDataSourceDynamicDataSourceMybatisPlus
0 likes · 14 min read

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.
AbstractRoutingDataSourceJavaMyBatis Plus
0 likes · 18 min read

This article demonstrates how to implement dynamic data source switching in a Spring Boot application by leveraging ThreadLocal and AbstractRoutingDataSource, providing step‑by‑step code examples for context holders, custom routing, annotation‑driven switching, and runtime addition of new data sources.
AOPAbstractRoutingDataSourceDynamicDataSource
0 likes · 14 min read

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.
AbstractRoutingDataSourceJavaMulti-Database Transaction
0 likes · 15 min read


IT NiukeJan 8, 2024 · Backend Development
This article walks through implementing dynamic data‑source switching in SpringBoot by combining ThreadLocal with AbstractRoutingDataSource, covering manual code, configuration, annotation‑driven AOP, and runtime addition of new data sources, complete with test cases and sample code.
AOPAbstractRoutingDataSourceMyBatis Plus
0 likes · 17 min read

This article demonstrates how to build a custom dynamic data‑source solution for Spring Boot by using ThreadLocal to store the current datasource key, extending AbstractRoutingDataSource for routing, configuring multiple datasources in application.yml, and optionally adding annotation‑driven switching and runtime datasource registration.
AbstractRoutingDataSourceDynamicDataSourceJava
0 likes · 15 min read

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.
AbstractRoutingDataSourceBackendMyBatis Plus
0 likes · 15 min read

This article explains how to dynamically manage multiple Spring data sources, switch them at runtime using AbstractRoutingDataSource, and ensure transactional consistency across databases by implementing custom AOP, connection proxies, and multi‑transaction annotations.
AOPAbstractRoutingDataSourceJava
0 likes · 13 min read

The article explains how to dynamically manage multiple data sources and ensure transaction consistency in Spring applications by extending AbstractRoutingDataSource, using configuration‑file or database‑table approaches, and applying AOP‑based switching with custom transaction management.
AbstractRoutingDataSourceDynamicDataSourceJava
0 likes · 16 min read

When a Spring @Bean is defined with multiple names, only the first name becomes the bean identifier while the others become aliases that are ignored by type‑based Map injection, causing dynamic data‑source routing to fail unless the aliases are manually added back into the map.
AbstractRoutingDataSourceBackendJava
0 likes · 5 min read

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.
AOPAbstractRoutingDataSourceDataSource Routing
0 likes · 9 min read

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.
AOPAbstractRoutingDataSourceJava
0 likes · 17 min read

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.
AOPAbstractRoutingDataSourceDataSource Routing
0 likes · 17 min read

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.
AOPAbstractRoutingDataSourceDataSource Routing
0 likes · 15 min read
