Skip to content

go-etl is a toolset for data extraction, transformation and loading。(go-etl是一个集数据源抽取,转化,加载的工具集,提供强大的数据同步能力)

License

Notifications You must be signed in to change notification settings

Breeze0806/go-etl

Repository files navigation

go-etl

LICENSE Language Build Go Report Card GitHub release GitHub release date Coverage Status GoDoc

English | 简体中文

go-etl is a toolset for extracting, transforming, and loading data sources, providing powerful data synchronization capabilities.

go-etl will provide the following ETL capabilities:

  • The ability to extract and load data from mainstream databases is implemented in the storage package
  • The ability to extract and load data from data streams in a two-dimensional table-like format is implemented in the stream package
  • Similar data synchronization capabilities to datax, implemented in the datax package

Since I have limited energy, everyone is welcome to submit issues to discuss go-etl, let's make progress together!

Data Synchronization Tool

This data synchronization tool has the synchronization capability for the following data sources.

Type Data Source Reader Writer Document
Relational Database MySQL/Mariadb/Tidb ReadWrite
Postgres/Greenplum ReadWrite
DB2 LUW ReadWrite
SQL Server ReadWrite
Oracle ReadWrite
Sqlite3 ReadWrite
Unstructured Data Stream CSV ReadWrite
XLSX(excel) ReadWrite

Getting Started

Start data synchronization with the go-etl Data Synchronization User Manual

Data Synchronization Development Handbook

Refer to the go-etl Data Synchronization Developer Documentation to assist with your development.

Compile

Linux

Compilation dependencies
  1. golang 1.20 and later versions
  2. gcc 4.8 and later versions
build
make dependencies
make release
Removing DB2 dependency

Before compilation, it is necessary to use export IGNORE_PACKAGES=db2

export IGNORE_PACKAGES=db2
make dependencies
make release

windows

Compilation Dependencies:
  1. Mingw-w64 with gcc 7.2.0 or higher is required for compilation.
  2. Golang version 1.20 or above is necessary.
  3. The minimum compilation environment is Windows 7.
build
release.bat
Removing DB2 dependency

Before compilation, it is necessary to use set IGNORE_PACKAGES=db2

set IGNORE_PACKAGES=db2
release.bat

Compilation output

    +---datax---|---plugin---+---reader--mysql---|--README.md
    |                        | .......
    |                        |
    |                        |---writer--mysql---|--README.md
    |                        | .......
    |
    +---bin----datax
    +---exampales---+---csvpostgres----config.json
    |               |---db2------------config.json
    |               | .......
    |
    +---README_USER.md

  • The datax/plugin directory contains the documentation for various plugins.
  • The bin directory houses the data synchronization program, named datax.
  • The examples directory includes configuration files for data synchronization in different scenarios.
  • README_USER is the user manual or guide in English.

Module Introduction

datax

This package will provide an interface similar to Alibaba's DataX to implement an offline data synchronization framework in the Go programming language. The framework will enable users to perform data synchronization tasks efficiently and reliably, leveraging the power and flexibility of the Go language. It may include features such as pluggable data sources and destinations, support for various data formats, and robust error handling mechanisms.

readerPlugin(reader)—> Framework(Exchanger+Transformer) ->writerPlugin(riter)  

The system is built using a Framework + plugin architecture. In this design, the reading and writing of data sources are abstracted into Reader/Writer plugins, which are integrated into the overall synchronization framework.

  • Reader: The Reader module is responsible for data acquisition. It collects data from the source and sends it to the Framework.
  • Writer: The Writer module handles data writing. It continuously retrieves data from the Framework and writes it to the destination.
  • Framework: The Framework serves as the connection between the Reader and Writer. It functions as a data transmission channel, handling core technical aspects such as buffering, flow control, concurrency, and data transformation. This architecture allows for flexibility and scalability, as new data sources and destinations can be easily added by developing new Reader and Writer plugins, respectively.

For detailed information, please refer to the go-etl Data Synchronization Developer Documentation. This documentation provides guidance on how to use the go-etl framework for data synchronization, including information on its architecture, plugin system, and how to develop custom Reader and Writer plugins.

element

Currently, the data types and data type conversions in go-etl have been implemented. For more information, please refer to the go-etl Data Type Descriptions. This documentation provides details on the supported data types, their usage, and how to perform conversions between different types within the go-etl framework.

storage

database

We have now implemented basic integration for databases, abstracting the database dialect (Dialect) interface. For specific implementation details, please refer to the Database Storage Developer Guide. This guide provides information on how to work with different database dialects within the framework, allowing for flexible and extensible database support.

Stream

Primarily used for parsing byte streams, such as files, message queues, Elasticsearch, etc. The byte stream format can be CSV, JSON, XML, etc.

File

Focused on file parsing, including CSV, Excel, etc. It abstracts the InputStream and OutputStream interfaces. For specific implementation details, refer to the Developer Guide for Tabular File Storage.

Tools

A collection of utilities for compilation, adding licenses, etc.

DataX

Build
go generate ./...

This is the build command used to register developer-created reader and writer plugins into the program's code. Additionally, this command inserts compilation information, such as software version, Git version, Go compiler version, and compilation time, into the command line tool.

Plugin

A plugin template creation tool for data sources. It's used to create a new reader or writer template, in conjunction with the build command, to reduce the developer's workload.

Release

A packaging tool for the data synchronization program and user documentation.

License

Automatically adds a license to Go code files and formats the code using gofmt -s -w.

go run tools/license/main.go