Database Persistence Layer Architecture
1. Database Persistence Layer Architecture

2. Database Components
2.1 Druid
Druid is the best database connection pool in the Java language. Druid provides powerful monitoring and extension features.
2.2 MyBatis-Plus
MyBatis-Plus is an enhancement tool for MyBatis. It only enhances MyBatis without changing it, and is designed to simplify development and improve efficiency.
- GitHub: MyBatis-Plus
- Documentation: MyBatis-Plus
2.3 dynamic-datasource
dynamic-datasource-spring-boot-starter is a Spring Boot based starter for quickly integrating multiple data sources.
- GitHub: dynamic-datasource
- Documentation: dynamic-datasource
- Examples: dynamic-datasource
2.4 ShardingSphere
Apache ShardingSphere is a distributed SQL transaction and query engine that can enhance any database with capabilities such as data sharding, elastic scaling, and encryption.
- GitHub: ShardingSphere
- Documentation: ShardingSphere
- Examples: ShardingSphere
2.5 AnyLine
The core of AnyLine is a (No-ORM) database operation tool based on the spring-jdbc ecosystem. It abandons the tedious and rigid Service/Dao/Entity/*O/Mapper layers — no MyBatis, no various configurations, no various *O objects.
3. Secondary Development Reading Suggestions
Database development should not focus only on persistence layer components. You also need to evaluate the impact scope together with business tables, APIs, and frontend pages.
| Scenario | Recommended Document |
|---|---|
| Look up tables by business | Data Model And API Map |
| Look up modules by API | Backend Module Map |
| Look up data architecture | Data and Database Architecture |
| Look up frontend integration | Vue3 Frontend Development And Integration |
4. SQL Modification Notes
- Adding a new field requires synchronizing the Domain, Mapper, VO/DTO, frontend forms, and import/export logic.
- For multi-database editions, the Dameng, Kingbase, Oracle, Postgres, and SQL Server scripts must be synchronized.
- High-frequency device data should prefer the time-series database path; do not write to MySQL without restraint.
- For tables involving tenants and data permissions, query conditions must also handle the organization and user scope.
- Upgrade scripts must be rehearsed on a test database before going live, and a rollback plan must be prepared.

