PHPackages                             lijiajun9602/seata - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. lijiajun9602/seata

ActiveLibrary

lijiajun9602/seata
==================

Php Implementation For Seata.

16PHP

Since Dec 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/lijiajun9602/fescar-php)[ Packagist](https://packagist.org/packages/lijiajun9602/seata)[ RSS](/packages/lijiajun9602-seata/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

English | [中文](./README-CN.md)

[![seata Logo](https://camo.githubusercontent.com/773f0c772da4510ee5b365f9ef6b97850fe2c8af27ac1d5c89e0d70559b0cbbe/68747470733a2f2f696d672e616c6963646e2e636f6d2f696d6765787472612f69312f4f31434e3031317a304a665132373233516744695775485f2121363030303030303030373733382d322d7470732d313439372d3430312e706e67)](https://hyperf.wiki)

 [![Stable Version](https://camo.githubusercontent.com/379a35c74a77dc65ff20cca28fa1b3f907df3d89cf8af6ed48604cfc13c3bebf/68747470733a2f2f706f7365722e707567782e6f72672f64746d2d7068702f64746d2d636c69656e742f762f737461626c65)](https://github.com/seata/seata-php/releases) [![Php Version](https://camo.githubusercontent.com/3fe2b00a3b57acdbf9c6ee0890609712713224e8b654eff0d23e4a0ae3969828/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d382e302d627269676874677265656e2e7376673f6d61784167653d32353932303030)](https://www.php.net) [![dtm-client License](https://camo.githubusercontent.com/e79d7c7ce5fdc9c1bef1f3a4d2ac41de30055b6fd79afa53f854077666809d60/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73656174612f73656174612d7068702e737667)](https://github.com/seata/seata-php/master/LICENSE)

 [![PHPUnit for Seata-PHP](https://github.com/seata/seata-php/actions/workflows/test.yml/badge.svg)](https://github.com/seata/seata-php/actions) [![Total Downloads](https://camo.githubusercontent.com/e7a4dec686ab805b3b69d0e6263bec4eef50fe5ab8fe62d2af99736a339a5d97/68747470733a2f2f706f7365722e707567782e6f72672f73656174612f73656174612f646f776e6c6f616473)](https://packagist.org/packages/seata/seata) [![Monthly Downloads](https://camo.githubusercontent.com/2be058674be7f35f33ff14dfc7cdc0d6e56aa39f0b6d7398c9af15b64b41b5c7/68747470733a2f2f706f7365722e707567782e6f72672f73656174612f73656174612f642f6d6f6e74686c79)](https://packagist.org/packages/seata/seata)

Introduce
=========

[](#introduce)

[Seata](https://github.com/seata/seata) is a very mature distributed transaction framework, and is the de facto standard platform for distributed transaction technology in the Java field. [Seata-PHP](https://github.com/seata/seata-php) is the implementation version of PHP language in Seata multilingual ecosystem, which realizes the interoperability between Java and PHP, so that PHP developers can also use Seata-PHP to realize distributed transactions.

> **Before learning about the `Seata-PHP`, let's first understand what's the `Seata`**

What is Seata?
--------------

[](#what-is-seata)

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

### Distributed Transaction Problem in Microservices

[](#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](https://camo.githubusercontent.com/7313a92a3d2ec8a9aedf1f171b647b19104a0660a82c0567d8c2f3e23321aab2/68747470733a2f2f696d672e616c6963646e2e636f6d2f696d6765787472612f69332f4f31434e30314654746a79473148347676566831734e595f2121363030303030303030303730352d302d7470732d313130362d3637382e6a7067)](https://camo.githubusercontent.com/7313a92a3d2ec8a9aedf1f171b647b19104a0660a82c0567d8c2f3e23321aab2/68747470733a2f2f696d672e616c6963646e2e636f6d2f696d6765787472612f69332f4f31434e30314654746a79473148347676566831734e595f2121363030303030303030303730352d302d7470732d313130362d3637382e6a7067)

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](http://microservices.io/patterns/data/database-per-service.html)). Data consistency within every single service is naturally guaranteed by the local transaction.

**But how about the whole business logic scope?**

[![Microservices Problem](https://camo.githubusercontent.com/9d0480fe999c0b41e65939497c7a23f0fb09ca0d46a72f0e17b05fa7df62227a/68747470733a2f2f696d672e616c6963646e2e636f6d2f696d6765787472612f69312f4f31434e303144586b63336f317465396d6e4a63484f725f2121363030303030303030353932362d302d7470732d313236382d3830342e6a7067)](https://camo.githubusercontent.com/9d0480fe999c0b41e65939497c7a23f0fb09ca0d46a72f0e17b05fa7df62227a/68747470733a2f2f696d672e616c6963646e2e636f6d2f696d6765787472612f69312f4f31434e303144586b63336f317465396d6e4a63484f725f2121363030303030303030353932362d302d7470732d313236382d3830342e6a7067)

### How Seata do?

[](#how-seata-do)

Seata is just a solution to the problem mentioned above.

[![Seata solution](https://camo.githubusercontent.com/25441b39e10a5d6bcd8dbfc63e5cdecb4699d427bc7fe0609984770a482e4f21/68747470733a2f2f696d672e616c6963646e2e636f6d2f696d6765787472612f69312f4f31434e30314668656c6948316b35564849526f6233705f2121363030303030303030343633322d302d7470732d313533342d3930382e6a7067)](https://camo.githubusercontent.com/25441b39e10a5d6bcd8dbfc63e5cdecb4699d427bc7fe0609984770a482e4f21/68747470733a2f2f696d672e616c6963646e2e636f6d2f696d6765787472612f69312f4f31434e30314668656c6948316b35564849526f6233705f2121363030303030303030343633322d302d7470732d313533342d3930382e6a7067)

Firstly, how to define a **Distributed Transaction**?

We say, a **Distributed Transaction** is a **Global Transaction** which is made up with a batch of **Branch Transaction**, and normally **Branch Transaction** is just **Local Transaction**.

[![Global & Branch](https://camo.githubusercontent.com/5161df872eb7feb60d04d3d28f113e81e9be34376349e420fc054668e3bb30dd/68747470733a2f2f63646e2e6e6c61726b2e636f6d2f6c61726b2f302f323031382f706e672f31383836322f313534353031353435343937392d61313865313666362d656434312d343466312d396337612d6264383263346435666639392e706e67)](https://camo.githubusercontent.com/5161df872eb7feb60d04d3d28f113e81e9be34376349e420fc054668e3bb30dd/68747470733a2f2f63646e2e6e6c61726b2e636f6d2f6c61726b2f302f323031382f706e672f31383836322f313534353031353435343937392d61313865313666362d656434312d343466312d396337612d6264383263346435666639392e706e67)

There are three roles in 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](https://camo.githubusercontent.com/b6c6c2d512db6986f5d2f84062f82c490e0fc56c3210d06b61a472efe8a0a523/68747470733a2f2f63646e2e6e6c61726b2e636f6d2f6c61726b2f302f323031382f706e672f31383836322f313534353031333931353238362d34613930663064662d356664612d343165312d393165302d3261613364333331633033352e706e67)](https://camo.githubusercontent.com/b6c6c2d512db6986f5d2f84062f82c490e0fc56c3210d06b61a472efe8a0a523/68747470733a2f2f63646e2e6e6c61726b2e636f6d2f6c61726b2f302f323031382f706e672f31383836322f313534353031333931353238362d34613930663064662d356664612d343165312d393165302d3261613364333331633033352e706e67)

A typical lifecycle of 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](https://camo.githubusercontent.com/d7898c803416f509a48c2fc89b6f06e3ad6da900915699793bbc58f1a9c18485/68747470733a2f2f63646e2e6e6c61726b2e636f6d2f6c61726b2f302f323031382f706e672f31383836322f313534353239363931373838312d32366661626562392d373166612d346633652d386137612d6663333137643333383966342e706e67)](https://camo.githubusercontent.com/d7898c803416f509a48c2fc89b6f06e3ad6da900915699793bbc58f1a9c18485/68747470733a2f2f63646e2e6e6c61726b2e636f6d2f6c61726b2f302f323031382f706e672f31383836322f313534353239363931373838312d32366661626562392d373166612d346633652d386137612d6663333137643333383966342e706e67)

For more details about principle and design, please go to [Seata wiki page](https://seata.io/en-us/docs/overview/what-is-seata.html).

Seata-PHP TODO List
-------------------

[](#seata-php-todo-list)

- TCC
- XA
- AT
- SAGA
- TM
- RPC communication
- Transaction anti suspension
- Null compensation
- Registration Center
- Metric monitoring
- Examples

How to run？
-----------

[](#how-to-run)

1. First download [**seata java**](https://seata.io/zh-cn/blog/download.html) and Start the TC service. For the specific process, refer to [**seata deployment guide**](https://seata.io/zh-cn/docs/ops/deploy-guide-beginner.html) Documentation
2. Run seata-php whith [**seata-skeleton**](https://github.com/PandaLIU-1111/seata-skeleton)

How to join us？
---------------

[](#how-to-join-us)

Seata-PHP is currently in the construction stage. Welcome colleagues in the industry to join the group and work with us to promote the construction of Seata-PHP! If you want to contribute code to Seata-PHP, you can refer to the [**code contribution Specification**](./docs/en/300.contributing/README.md) document to understand the specifications of the community, or you can join our community DingTalk group: 44788115 and communicate together!

License
-------

[](#license)

Seata-PHP uses Apache license version 2.0. Please refer to the [license file](https://github.com/seata/seata-php/blob/master/LICENSE) for more information.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/241d7bd8e53ef948603ccc08e04e74edd0b2e771f040ab8e1623d4247e7aa964?d=identicon)[lijiajun9602](/maintainers/lijiajun9602)

---

Top Contributors

[![lijiajun9602](https://avatars.githubusercontent.com/u/29647570?v=4)](https://github.com/lijiajun9602 "lijiajun9602 (6 commits)")

### Embed Badge

![Health badge](/badges/lijiajun9602-seata/health.svg)

```
[![Health](https://phpackages.com/badges/lijiajun9602-seata/health.svg)](https://phpackages.com/packages/lijiajun9602-seata)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
