Giter Club home page Giter Club logo

database-sync-1's Introduction

database_sync

sqlserver,mysql到mysql的数据同步工具,可以扩展数据处理方法,可以多线程处理.
写成框架的形式,方便套用,需要的话,直接打包就能放在服务器上定期执行;
此工具需求是由公司项目需要重构一套很老的erp系统,原本系统的数据库使用的是sqlserver,而新系统的使用的数据库是mysql;
需求:增量同步,可重复同步,新老数据库表结构不同,数据不同的处理,可以多线程,有单表和模块的事务管理,自定义查询条件;
目前上传的工具将公司的业务需求剔除,只留基本方法供大家使用;

How to start

我写了一套demo放在database_sync_demo中;
这个只是简单了实现了一些常用方法.
使用方法是,找一个mysql的数据库运行demo中的test.sql,并在dbsyncconfig.properties中配置刚才说的数据库连接;应该就可以使用了;(这里默认了配置数据库是mysql)
之后有时间我会详细的讲一讲如何构造自己需要的数据处理方法

结语

这个工具一共经历过三个版本;

一开始只实现了表对表的不做任何处理的同步;
后来由于表对表的同步会涉及到数据处理,表结构不同的问题,做了可扩展的接口,做到读取sql,写入sql和处理方法的自定义;
最近由于老板要求效率问题.又引入多线程;

目前是从公司溜了,这个工具还是有很大的效率瓶颈(比如说将数据拆分读取,目前是用的一个resultSet来读取数据),但是广度也是很宽的(例如将一个字段的数据拆成几行数据,只要脑洞够大),大家有需要自取,有建议马上告诉我,第一次发工具,请大家不要见笑;

database-sync-1's People

Contributors

rephan-3pro avatar hanlipeng avatar

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.