|
1 | | -# fescar |
| 1 | +# FESCAR: Fast & EaSy Commit And Rollback |
| 2 | + |
| 3 | +[](https://www.apache.org/licenses/LICENSE-2.0.html) |
| 4 | + |
| 5 | +------- |
| 6 | + |
| 7 | +## What is FESCAR? |
| 8 | + |
| 9 | +A **distributed transaction solution** with high performance and ease of use for **microservices** architecture. |
| 10 | + |
| 11 | +### Distributed Transaction Problem in Microservices |
| 12 | + |
| 13 | +Let's image a traditional monolithic application. Its business is built up with 3 modules. They use a single local data source. |
| 14 | + |
| 15 | +Naturally, data consistency will be guaranteed by local transaction. |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +Thing changed in microservices architecture. The 3 modules mentioned 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 local transaction. |
| 20 | + |
| 21 | +**But how about the whole business logic scope?** |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +### How FESCAR do? |
| 26 | + |
| 27 | +FESCAR is just a solution for problem mentioned above. |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +Firstly, how to define a **Distributed Transaction**? |
| 32 | + |
| 33 | +We say, a **Distributed Transaction** is a **Global Transaction** which is made up with batch of **Branch Transation**, and normally **Branch Transation** is just **Local Transaction**. |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +There are 3 basic components in FESACR: |
| 38 | + |
| 39 | +- **Transaction Coordinator(TC): **Maintain status of global and branch transactions, drive the global commit or rollback. |
| 40 | +- **Transaction Manager(TM): **Define the scope of global transaction: begin a global transaction, commit or rollback a global transaction. |
| 41 | +- **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. |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +A typical lifecycle of FESCAR managed distributed transaction: |
| 46 | + |
| 47 | +1. TM asks TC to begin a new global transaction. TC generates a XID representing the global transaction. |
| 48 | +2. XID is propagated through microservices' invoke chain. |
| 49 | +3. RM register local transaction as a branch of the corresponding global transaction of XID to TC. |
| 50 | +4. TM asks TC for committing or rollbacking the corresponding global transaction of XID. |
| 51 | +5. TC drives all branch transactions under the corresponding global transaction of XID to finish branch committing or rollbaking. |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +For more details about principle and design, please go to [FESCAR wiki page](https://github.com/alibaba/fescar/wiki). |
| 56 | + |
| 57 | +### History |
| 58 | + |
| 59 | +- **TXC**: Taobao Transaction Constructor. Alibaba middleware team start this project since 2014 to meet dirstribuited transaction problem caused by application architecture change from monolithic to microservices. |
| 60 | +- **GTS**: Global Transaction Service. TXC as a Aliyun middleware product with new name GTS was published since 2016. |
| 61 | +- **FESCAR**: we start the open source project FESCAR based on TXC/GTS since 2019 to work closly with community in the future. |
| 62 | + |
| 63 | + |
| 64 | +## Quick Start |
| 65 | + |
| 66 | +[Quick Start](https://github.com/alibaba/fescar/wiki/Quick-Start) |
| 67 | + |
| 68 | +## Documentation |
| 69 | + |
| 70 | +You can view the full documentation from wiki: [FESCAR wiki page](https://github.com/alibaba/fescar/wiki). |
| 71 | + |
| 72 | +## Reporting bugs |
| 73 | + |
| 74 | +Please follow the [template](https://github.com/apache/incubator-dubbo/issues/new?template=dubbo-issue-report-template.md) for reporting any issues. |
| 75 | + |
| 76 | + |
| 77 | +## Contributing |
| 78 | + |
| 79 | +Contributors are welcomed to join FEATS project. Please check [CONTRIBUTING](./CONTRIBUTING.md) about how to contribute to this project. |
| 80 | + |
| 81 | + |
| 82 | +## Contact |
| 83 | + |
| 84 | +* [Gitter](https://gitter.im/alibaba/nacos): TBD. FESCAR's IM tool for community messaging, collaboration and discovery. |
| 85 | +* [Twitter](https://twitter.com/nacos2): TBD. Follow along for latest FESCAR news on Twitter. |
| 86 | +* [Weibo](https://weibo.com/u/6574374908): TBD. Follow along for latest FESCAR news on Weibo (Twitter of China version). |
| 87 | +* [Segmentfault](https://segmentfault.com/t/nacos): TBD. Get latest notice and prompt help from Segmentfault. |
| 88 | +* Email Group: |
| 89 | + * TBD: FESCAR usage general discussion. |
| 90 | + * TBD: FESCAR developer discussion (APIs, feature design, etc). |
| 91 | + * TBD: Commits notice, very high frequency. |
| 92 | + |
| 93 | +## License |
| 94 | + |
| 95 | +FESCAR is under the Apache 2.0 license. See the [LICENSE](https://github.com/apache/incubator-dubbo/blob/master/LICENSE) file for details. |
| 96 | + |
0 commit comments