go-etl

module
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2024 License: Apache-2.0

README

go-etl

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

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
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-etlData Synchronization Developer Documentation to assist with your development.

Compile
Linux
Compilation dependencies
  1. golang 1.16 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.16 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

Directories

Path Synopsis
cmd
Package config provides JSON configuration
Package config provides JSON configuration
Package datax mainly implements the offline data synchronization framework
Package datax mainly implements the offline data synchronization framework
Package element provides various types of column values, columns, records, and record channels
Package element provides various types of column values, columns, records, and record channels
Package schedule: Provides resource mapping and task scheduler
Package schedule: Provides resource mapping and task scheduler
storage
database
Package database Packages the database that implements the interface of the standard library database/sql
Package database Packages the database that implements the interface of the standard library database/sql
database/db2
Package db2 implements the Dialect of db2 database, supporting the corresponding database of db2 9.x+
Package db2 implements the Dialect of db2 database, supporting the corresponding database of db2 9.x+
database/mysql
Package mysql implements the Dialect of mysql database, supporting the corresponding database of mysql 5.7+
Package mysql implements the Dialect of mysql database, supporting the corresponding database of mysql 5.7+
database/oracle
Package oracle implements the Dialect for Oracle databases, supporting Oracle 10.5+ corresponding databases.
Package oracle implements the Dialect for Oracle databases, supporting Oracle 10.5+ corresponding databases.
database/postgres
Package postgres implements the Dialect for PostgreSQL databases, supporting PostgreSQL 8.0+ corresponding databases.
Package postgres implements the Dialect for PostgreSQL databases, supporting PostgreSQL 8.0+ corresponding databases.
database/sqlserver
Package sqlserver implements the Dialect for SQL Server databases, supporting MSSQL 2005+ corresponding databases.
Package sqlserver implements the Dialect for SQL Server databases, supporting MSSQL 2005+ corresponding databases.
stream/file
Package file implements a framework for file input and output streams, which can be used for all types of two-dimensional table file input and output
Package file implements a framework for file input and output streams, which can be used for all types of two-dimensional table file input and output
stream/file/compress
Package compress mainly implements compression methods.
Package compress mainly implements compression methods.
stream/file/csv
Package csv mainly implements the stream/file interface.
Package csv mainly implements the stream/file interface.
stream/file/xlsx
Package xlsx mainly implements the stream/file interface.
Package xlsx mainly implements the stream/file interface.
tools

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL