Git Product home page Git Product logo

hptx's Introduction

hptx

LICENSE GitHub Workflow Status GoDoc Go Report Card GitHub Release

High-performance non-intrusive distributed transaction solution, inspired by kubernetes, only for golang language.


Features

  • Event driven, High-performance and non-intrusive
  • Support XA mode、EAT mode And TCC mode
  • Support check global lock in local transaction

Theory

The distributed transaction principle of hptx and dbpack is the same. For details, please refer to: https://cectc.github.io/dbpack-doc/#/en-us/distributed_transaction

Requirements

  • Go 1.16 or higher.
  • ETCD(3+)
  • AT mode: Mysql (5.7+), MariaDB

Installation

Simple install the package to your $GOPATH with the go tool from shell:

$ go get -u github.com/cectc/hptx

If you use AT mode to solve distributed transaction problems, you should also install the following package:

$ go get -u github.com/cectc/mysql

Make sure Git is installed on your machine and in your system's PATH.

Usage

You should have your ETCD ready first. then, you can initialize hptx via hptx.InitFromFile:

import (
	"github.com/cectc/hptx"
	"github.com/cectc/hptx/pkg/config"
	"github.com/cectc/hptx/pkg/resource"
	"github.com/cectc/mysql"
)
  
//...

hptx.InitFromFile("${path of your config file}")
// If you use at mode, initial with following code 
mysql.RegisterATResource(config.GetATConfig().DSN)

It is also possible to set the configuration directly:

import (
	"github.com/cectc/hptx"
	"github.com/cectc/hptx/pkg/config"
	"github.com/cectc/hptx/pkg/resource"
	"github.com/cectc/mysql"
)
  
//...

// Fill in the fields as needed.
hptx.InitWithConf(&config.DistributedTransaction{
    ApplicationID:                    "",
    RetryDeadThreshold:               0,
    RollbackRetryTimeoutUnlockEnable: false,
    EtcdConfig:                       clientv3.Config{},
    ATConfig:                         config.ATConfig{},
    TMConfig:                         config.TMConfig{},
})
// If you use at mode, initial with following code 
mysql.RegisterATResource(config.GetATConfig().DSN)

Support GlobalLock:

db.ExecContext(context.WithValue(context.Background(), "GlobalLock", true), sql, args...)

Examples are available in our repos

Stargazers

Stargazers repo roster for cectc/hptx

License

hptx is licensed under the GNU General Public License v3.0.

hptx's People

Contributors

dk-lockdown avatar fatelei avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hptx's Issues

Are you using hptx?

Are you using hptx?

If you are using hptx, first we would like to Thank You. Our goal is to grow the community, improve hptx and help each other.

The purpose of this issue

We are always interested in finding out who is using hptx, what attracted you to using it, how we can listen to your needs and if you are interested, help promote your organization.

  • We have people reaching out to us asking, who uses hptx in production?
  • We’d like to listen to what you would like to see in hptx and your scenarios?
  • We'd like to help promote your organization and work with you

What we would like from you

Submit a comment in this issue to include the following information:

  • Organization: CECTC (Required)
  • Location: wuhan, hubei, China(Required)
  • Contact: [email protected] (Optional)
  • Usage:used to solving distibuted transaction problem (Required)
  • TransactionMode: AT\TCC
  • Version: 0.1.0(Optional)
  • Icon (Preferred)

Thanks again for your participation!

欢迎使用 hptx,首先感谢您的使用,其次您可以参考下面的样例来提供您的信息以收集使用场景帮助提升改进:

* 组织:**电子云(Required)
* 地点:**武汉(Required)
* 联系方式:[email protected](Optional)
* 用途:解决电商场景下的分布式事务问题(Required)
* 事务模式:AT\TCC
* 版本: 0.1.0(Optional)
* 公司图标:(Preferred)

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.