MCPcopy
hub / github.com/apache/incubator-seata

github.com/apache/incubator-seata @v2.6.0 sqlite

repository ↗ · DeepWiki ↗ · release v2.6.0 ↗
33,191 symbols 120,962 edges 2,848 files 8,653 documented · 26%
README

Apache Seata (incubating): Simple Extensible Autonomous Transaction Architecture

build codecov license maven

What is Apache Seata (incubating)?

A distributed transaction solution with high performance and ease of use for microservices architecture.

Distributed Transaction Problem in Microservices

Let's imagine a traditional monolithic application. Its business is built up with 3 modules. They use a single local data source.

Naturally, data consistency will be guaranteed by the local transaction.

Monolithic App

Things have changed in a microservices architecture. The 3 modules mentioned above are designed to be 3 services on top of 3 different data sources (Pattern: Database per service). Data consistency within every single service is naturally guaranteed by the local transaction.

But how about the whole business logic scope?

Microservices Problem

Architecture

Apache Seata offers a robust solution to the distributed transaction challenges in microservices.

Seata solution

Core Concepts

A Distributed Transaction is a Global Transaction composed of a batch of Branch Transactions, where a Branch Transaction is typically a Local Transaction.

Global & Branch

Roles

There are three main roles in the Apache Seata Framework:

  • Transaction Coordinator(TC): Maintain status of global and branch transactions, drive the global commit or rollback.
  • Transaction Manager(TM): Define the scope of global transaction: begin a global transaction, commit or rollback a global transaction.
  • Resource Manager(RM): Manage resources that branch transactions working on, talk to TC for registering branch transactions and reporting status of branch transactions, and drive the branch transaction commit or rollback.

Model

Transaction Lifecycle

A typical lifecycle of an Apache Seata managed distributed transaction:

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

Typical Process

For more details about principle and design, please go to Apache Seata wiki page.

History

Alibaba
  • TXC: Taobao Transaction Constructor. Alibaba middleware team started this project since 2014 to meet the distributed transaction problems caused by application architecture change from monolithic to microservices.
  • GTS: Global Transaction Service. TXC as an Aliyun middleware product with new name GTS was published since 2016.
  • Fescar: we started the open source project Fescar based on TXC/GTS since 2019 to work closely with the community in the future.
Ant Financial
  • XTS: Extended Transaction Service. Ant Financial middleware team developed the distributed transaction middleware since 2007, which is widely used in Ant Financial and solves the problems of data consistency across databases and services.

  • DTX: Distributed Transaction Extended. Since 2013, XTS has been published on the Ant Financial Cloud, with the name of DTX .

Seata Community
  • Seata: Simple Extensible Autonomous Transaction Architecture. Ant Financial joins Fescar, which make it to be a more neutral and open community for distributed transaction, and Fescar be renamed to Seata.
  • Apache Seata: In October 2023, Seata entered the Apache Incubator.

Maven dependency

Depending on the scenario, choose one of the two dependencies: org.apache.seata:seata-all or org.apache.seata:seata-spring-boot-starter.

<properties>
  <seata.version>2.5.0</seata.version>
</properties>

<dependencies>

  <dependency>
    <groupId>org.apache.seata</groupId>
    <artifactId>seata-all</artifactId>
    <version>${seata.version}</version>
  </dependency>



  <dependency>
    <groupId>org.apache.seata</groupId>
    <artifactId>seata-spring-boot-starter</artifactId>
    <version>${seata.version}</version>
  </dependency>
</dependencies>

Quick Start

Quick Start

Documentation

You can view the full documentation from Apache Seata Official Website: Apache Seata Website page.

Reporting bugs

Please follow the template for reporting any issues.

Security

Please do not use our public issue tracker but refer to our security policy

Contributing

Contributors are welcomed to join the Apache Seata project. Please check CONTRIBUTING and CONTRIBUTING-CN about how to contribute to this project.

Contact

Dingtalk group Wechat official account QQ group Wechat assistant

Apache Seata ecosystem

Contributors

This project exists thanks to all the people who contribute. [Contributors].

License

Apache Seata is under the Apache 2.0 license. See the LICENSE file for details.

Who is using

These are only part of the companies using Apache Seata, for reference only. If you are using Apache Seata, please add your company here to tell us your scenario to make Apache Seata better.

<img alt='Alibaba Group' height='40'  src='https://img.alicdn.com/imgextra/i1/O1CN01TleQq128FAP8POtL5_!!6000000007902-2-tps-241-42.png'  /img>
<img alt='蚂蚁金服' height='40'  src='https://img.alicdn.com/tfs/TB1wuuCoET1gK0jSZFhXXaAtVXa-496-202.jpg'  /img>
<img alt='阿里云' height='40'  src='https://img.alicdn.com/tfs/TB1Ly5oS3HqK1RjSZFPXXcwapXa-238-54.png'  /img>
<img alt='中航信' height='40'  src='https://img.alicdn.com/imgextra/i3/O1CN01Hohqhm1JvGPE4cSD4_!!6000000001090-1-tps-436-84.gif'  /img>
<img alt='联通(浙江)' height='40'  src='https://img.alicdn.com/tfs/TB1hvabw9f2gK0jSZFPXXXsopXa-174-100.png'  /img>
<img alt='中国铁塔' height='40'  src='https://img.alicdn.com/imgextra/i3/O1CN01qkkEMZ1Jr8qDmXdAa_!!6000000001081-2-tps-220-67.png'  /img>
<img alt='滴滴' height='40'  src='https://img.alicdn.com/imgextra/i3/O1CN01RXbaWn1SDbBfpCs1B_!!6000000002213-0-tps-640-458.jpg'  /img>
<img alt='中国邮政' height='40'  src='https://img.alicdn.com/imgextra/i1/O1CN01Rkw4z01OPGomOisU1_!!6000000001697-2-tps-220-64.png'  /img>
<img alt='58集团' height='40'  src='https://img.alicdn.com/imgextra/i3/O1CN01y0Wwc51wxnbw9FDJi_!!6000000006375-2-tps-252-84.png'  /img>
<img alt='南航' height='40'  src='https://img.alicdn.com/tfs/TB1GMQpZHY1gK0jSZTEXXXDQVXa-203-63.png'  /img>
<img alt='TCL' height='40'  src='https://img.alicdn.com/tfs/TB1oHThw.Y1gK0jSZFCXXcwqXXa-214-200.png'  /img>
<img alt='韵达快递' height='40'  src='https://img.alicdn.com/imgextra/i3/O1CN01McNkv624Z5AKVHR0h_!!6000000007404-2-tps-140-54.png'  /img>
<img alt='科大讯飞' height='40'  src='https://img.alicdn.com/tfs/TB1x0p5jxvbeK8jSZPfXXariXXa-272-83.png'  /img>
<img alt='奇虎360' height='40'  src='https://img.alicdn.com/imgextra/i2/O1CN01M9aSuY1nQWGxoVQu9_!!6000000005084-2-tps-239-78.png' /img>
<img alt='收钱吧' height='40' src='https://img.alicdn.com/imgextra/i1/O1CN01PmTFnO1gZ2K7GUpgh_!!6000000004155-2-tps-2406-747.png' /img>
<img alt='太极计算机' height='40'  src='https://img.alicdn.com/tfs/TB1.zqEoAL0gK0jSZFAXXcA9pXa-245-38.png'  /img>
<img alt='美的集团' height='40' src='https://img.alicdn.com/tfs/TB1cgvjwYj1gK0jSZFOXXc7GpXa-1040-282.png'  /img>    
<img alt='中国网安' height='40' src='https://img.alicdn.com/imgextra/i3/O1CN01OioqXX1dfxSxg6DYn_!!6000000003764-2-tps-574-122.png' /img>
<img alt='政采云' height='40'  src='https://img.alicdn.com/tfs/TB1DDiCorY1gK0jSZTEXXXDQVXa-440-114.jpg'  /img>
<img alt='浙江公安厅' height='40'  src='https://img.alicdn.com/tfs/TB1SXGzoxn1gK0jSZKPXXXvUXXa-426-180.jpg'  /img>
<img alt='特步' height='40'  src='https://img.alicdn.com/imgextra/i1/O1CN01qo6gfd1l7AK1LIF8t_!!6000000004771-2-tps-132-40.png'  /img>
<img alt='中通快递' height='40'  src='https://img.alicdn.com/tfs/TB1rCNSFxn1gK0jSZKPXXXvUXXa-172-31.png'  /img>
<img alt='欧莱雅百库' height='40'  src='https://img.alicdn.com/tfs/TB1Xa3bZQL0gK0jSZFtXXXQCXXa-936-93.png'  /img> 
<img alt='浙江烟草' height='40'  src='https://img.alicdn.com/tfs/TB1e7Wiovb2gK0jSZK9XXaEgFXa-1028-160.jpg'  /img>
<img alt='波司登' height='40'  src='https://img.alicdn.com/tfs/TB12cmCouL2gK0jSZFmXXc7iXXa-310-110.jpg'  /img> 
<img alt='凯京科技' height='40'  src='https://img.alicdn.com/tfs/TB1j0dEop67gK0jSZPfXXahhFXa-400-208.jpg'  /img>
<img alt='点购集团' height='40'  src='https://img.alicdn.com/imgextra/i1/O1CN01edO0ox1Nu7syhwbAy_!!6000000001629-2-tps-300-112.png'  /img>
<img alt='求是创新健康' height='40'  src='https://img.alicdn.com/imgex

Extension points exported contracts — how you extend this code

Gauge (Interface)
Gauge interface for metrics [33 implementers]
metrics/seata-metrics-api/src/main/java/org/apache/seata/metrics/Gauge.java
MessageTypeAware (Interface)
The interface Message type aware. [41 implementers]
core/src/main/java/org/apache/seata/core/protocol/MessageTypeAware.java
MessageSeataCodec (Interface)
The interface Message seata codec. [20 implementers]
serializer/seata-serializer-seata/src/main/java/org/apache/seata/serializer/seata/MessageSeataCodec.java
Business (Interface)
The interface Business. [8 implementers]
compatible/src/test/java/io/seata/integration/tx/api/interceptor/parser/Business.java
SagaTransactionalTemplate (Interface)
Template of executing business logic with a global transaction for SAGA mode [8 implementers]
saga/seata-saga-spring/src/main/java/org/apache/seata/saga/engine/tm/SagaTransactionalTemplate.java
ProcessRouter (Interface)
Process Router [8 implementers]
saga/seata-saga-processctrl/src/main/java/org/apache/seata/saga/proctrl/ProcessRouter.java
Serializer (Interface)
Object serializer [27 implementers]
saga/seata-saga-engine/src/main/java/org/apache/seata/saga/engine/serializer/Serializer.java
StateParser (Interface)
State Parser [12 implementers]
saga/seata-saga-statelang/src/main/java/org/apache/seata/saga/statelang/parser/StateParser.java

Core symbols most depended-on inside this repo

getToken
called by 2922
console/src/main/java/org/apache/seata/mcp/service/impl/ConsoleRemoteServiceImpl.java
get
called by 2650
core/src/main/java/org/apache/seata/core/context/ContextCore.java
put
called by 2031
core/src/main/java/org/apache/seata/core/context/ContextCore.java
match
called by 1882
saga/seata-saga-engine/src/main/java/org/apache/seata/saga/engine/pcext/StateRouterInterceptor.java
assertNotNull
called by 1821
extensions/rpc/seata-rpc-core/src/main/java/org/apache/seata/integration/rpc/core/BaseRpcFilter.java
add
called by 1464
rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/Row.java
LA
called by 1236
sqlparser/seata-sqlparser-antlr/src/main/java/org/apache/seata/sqlparser/antlr/mysql/stream/ANTLRNoCaseStringStream.java
append
called by 757
server/src/main/java/org/apache/seata/server/logging/logback/appender/MetricLogbackAppender.java

Shape

Method 29,196
Class 3,366
Interface 356
Function 195
Enum 78

Languages

Java99%
TypeScript1%
Python1%

Modules by API surface

sqlparser/seata-sqlparser-antlr/src/main/java/org/apache/seata/sqlparser/antlr/mysql/parser/MySqlParser.java7,505 symbols
sqlparser/seata-sqlparser-antlr/src/main/java/org/apache/seata/sqlparser/antlr/mysql/parser/MySqlParserBaseListener.java1,143 symbols
sqlparser/seata-sqlparser-antlr/src/main/java/org/apache/seata/sqlparser/antlr/mysql/parser/MySqlParserListener.java1,139 symbols
sqlparser/seata-sqlparser-antlr/src/main/java/org/apache/seata/sqlparser/antlr/mysql/parser/MySqlParserVisitor.java570 symbols
sqlparser/seata-sqlparser-antlr/src/main/java/org/apache/seata/sqlparser/antlr/mysql/parser/MySqlParserBaseVisitor.java570 symbols
rm-datasource/src/test/java/org/apache/seata/rm/datasource/mock/MockDatabaseMetaData.java178 symbols
compatible/src/test/java/io/seata/rm/datasource/mock/MockDatabaseMetaData.java178 symbols
core/src/test/java/org/apache/seata/core/rpc/netty/AbstractNettyRemotingClientTest.java140 symbols
extensions/rpc/seata-brpc/src/test/java/org/apache/seata/integration/brpc/dto/Echo.java135 symbols
rm-datasource/src/test/java/org/apache/seata/rm/datasource/undo/UndoExecutorTest.java113 symbols
extensions/rpc/seata-http/src/test/java/org/apache/seata/integration/http/MockHttpServletRequest.java69 symbols
server/src/main/java/org/apache/seata/server/session/GlobalSession.java67 symbols

Dependencies from manifests, versioned

${project.groupId}:seata-all
${project.groupId}:seata-common
${project.groupId}:seata-compressor-all
${project.groupId}:seata-compressor-bzip2
${project.groupId}:seata-compressor-deflater
${project.groupId}:seata-compressor-gzip
${project.groupId}:seata-compressor-lz4
${project.groupId}:seata-compressor-zip
${project.groupId}:seata-compressor-zstd
${project.groupId}:seata-config-all
${project.groupId}:seata-config-apollo
${project.groupId}:seata-config-consul

Datastores touched

(mysql)Database · 1 repos
seataDatabase · 1 repos
db2Database · 1 repos
db1Database · 1 repos
demoDatabase · 1 repos
dbDatabase · 1 repos
db3Database · 1 repos
new_dbDatabase · 1 repos

For agents

$ claude mcp add incubator-seata \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact