Coder Social home page Coder Social logo

dingyaning / easymulti-datasource Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wujiuye/easymulti-datasource

0.0 1.0 0.0 738 KB

提供适配mybatis、r2dbc的动态多数据源框架。提供两种动态多数据源:主从数据源 和 非主从的多数据源;其中easymulti-datasource-mybatis还支持:监听sql实现埋点事件、支持监听/跟踪事务状态(包括使用AOP时监听事务,在事务提交后再执行切面要做的事情)。

License: Apache License 2.0

Java 100.00%

easymulti-datasource's Introduction

easymulti-datasource

多数据源动态切换似乎已经成了微服务的标配,做过那么多项目发现每个项目都要配一个动态数据源,都要写一个切面去实现动态切换,因此,我想将这些繁琐的配置封装为starter,拿来即用。

easymulti-datasource支持主从库模式,如果多于两个数据源,可切换为普通模式使用,普通模式支持最多十个数据源。使用非常简单,只需要简单的在yml中配置数据源,就可以使用动态多数据源,然后在项目中使用注解切换数据源,当然,也支持直接调用API切换数据源。

通知

easymulti-datasource-spring-boot-starter项目已更名为easymulti-datasource,原easymulti-datasource-spring-boot-starter组件已经更名为easymulti-datasource-mybatis。新版本增加了easymulti-datasource-r2dbc(原hotkit-r2dbc)。

模块

easymulti-datasource-mybatis

Maven central License mybatis版多数据源组件,整合了mybatis-plus,不再需要繁琐的配置;

文档

特色

  • 提供两种动态多数据源模式:主从数据源模式/非主从的多数据源模式;
  • 每个数据源独立的连接池配置,可针对每个数据源单独配置连接池;
  • 支持监听SQL,监听修改某个表的某些字段的sql,用于实现埋点事件;
  • 支持事务状态监听、注册事务监听器,用于在事务回滚/提交时再完成一些后台操作。

easymulti-datasource-r2dbc

Maven central License spring-data-r2dbc版多数据源组件,用于响应式编程; ####文档

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.