Code Monkey home page Code Monkey logo

seata-golang's Introduction

seata-golang

LICENSE codecov

Introduction | 中文

seata-golang is a distributed transaction middleware based on Golang.

difference between seata-glang and seata

feature seata seata-golang remark
AT mode
TCC mode
SAGA mode ☑️
rpc dev branch
grpc ☑️ v2 branch

Architecture

seata-flow

A typical lifecycle of Seata managed distributed transaction:

  • TM asks TC to begin a new global transaction. TC generates an XID representing the global transaction.
  • XID is propagated through microservices' invoke chain.
  • RM registers local transaction as a branch of the corresponding global transaction of XID to TC.
  • TM asks TC for committing or rolling back the corresponding global transaction of XID.
  • TC drives all branch transactions under the corresponding global transaction of XID to finish branch committing or rolling back.

Directory structure

  • cmd: to startup TC server
    • profiles/dev/config.yml: TC config file
    • tc/main.go: TC startup entrance
  • dist: to build in docker container
  • docs: documentations
  • pkg: TC + RM + TM implementation
    • server/db/*.sql: sql scripts to create DB and tables for TC

Getting started

  • TC server

cd ${projectpath}/cmd/tc
go build -o tc_server
# create database `seata` for TC server
# update storage.dsn.mysql in ${projectpath}/cmd/profiles/dev/config.yml
./tc_server start -config ${projectpath}/cmd/profiles/dev/config.yml
  • Client

Please refer to demo seata-go-samples

  • Prerequisites

    • MySQL server
    • Golang version >= 1.15
    • Business tables that require primary key

Design and implementation

The seata-golang AT and TCC design are actually the same as seata.
Please refer to what-is-seata for more details.

Reference

Contact

Please contact us via DingTalk app if you have any issues. The chat group ID is 33069364.
DingTalk Group

Contributing

Welcome to raise up issue or pull-request to seata-golang!
To contribute, fork from opentrx/seata-golang and push branch to your repo, then open a pull-request.

License

seata-golang software is licenced under the Apache License Version 2.0. See the LICENSE file for details.

seata-golang's People

Contributors

dk-lockdown avatar hehe-rakuten avatar wybrobin avatar lazlaz avatar bohehe avatar luoyunhe avatar xiaobudongzhang avatar izturn avatar laijinhang avatar lewgun avatar xjlgod avatar yx9o avatar

Watchers

James Cloos avatar  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.