baomidou/dynamic-datasource

dynamic datasource for springboot 多数据源 动态数据源 主从分离 读写分离 分布式事务

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 49 minutes ago
Added to GitGenius on September 13th, 2026
Created on April 28th, 2018
Open Issues & Pull Requests: 8 (+0)
GitHub issues: Enabled
Number of forks: 1,240
Total Stargazers: 5,188 (+0)
Total Subscribers: 117 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 2.1 hours
Mean response time: 11.7 days
90th percentile: 37.1 days
Tracked items: 87

Most active contributors

Sign in to see contributor activity.

How this project is maintained

Around half of the issues opened in the past year never receive a reply. Only 14% of issues opened in the past year have been closed. Three people close 90% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 6
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 103 days
Stale 30+ days: 4
Stale 90+ days: 1

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

Detailed Description

Dynamic-datasource is a Spring Boot starter that enables rapid integration of multiple datasources in applications.

The tool addresses the complexity of managing multiple databases by providing a framework for datasource grouping that supports various architectural patterns including pure multi-database setups, read-write separation, primary-replica configurations, and hybrid modes. It works by allowing developers to define multiple datasources through configuration and switch between them dynamically at runtime using annotations and method-level declarations. The approach includes support for datasource encryption, lazy loading, and dynamic addition or removal of datasources after application startup.

Teams should adopt this tool when building applications that require multi-database support, read-write splitting, or distributed data access patterns. It suits projects using MyBatis or MyBatis-Plus that need to route queries to different databases based on business logic. The tool provides integration with popular connection pooling libraries including Druid, HikariCP, BeeCp, and DBCP2, and offers compatibility with related frameworks like Quartz, ShardingJdbc, and Seata for distributed transactions. It supports multiple Spring Boot versions and Java versions, making it adaptable to both legacy and modern Spring Boot applications.

The project maintains active development with regular updates across multiple Spring Boot major versions. The codebase shows consistent refinement of core features including the annotation system and dynamic datasource switching mechanisms. Documentation is actively maintained with a dedicated documentation site, and the project welcomes community contributions through a defined contribution process.