Convert Figma logo to code with AI

apache logoservicecomb-pack

Apache ServiceComb Pack is an eventually data consistency solution for micro-service applications. ServiceComb Pack currently provides TCC and Saga distributed transaction co-ordination solutions by using Alpha as a transaction coordinator and Omega as an transaction agent .

1,925
435
1,925
83

Top Related Projects

10,038

A distributed transaction framework, supports workflow, saga, tcc, xa, 2-phase message, outbox patterns, supports many languages.

3,214

Process Orchestration Framework

Flexible framework for workflow and decision automation with BPMN and DMN. Integration with Quarkus, Spring, Spring Boot, CDI.

Quick Overview

Apache ServiceComb Pack is a distributed transaction solution for microservices. It provides a set of components to help developers manage the lifecycle of distributed transactions, including compensation, eventual consistency, and eventual consistency with compensation.

Pros

  • Distributed Transaction Management: ServiceComb Pack provides a comprehensive solution for managing distributed transactions, including support for compensation, eventual consistency, and eventual consistency with compensation.
  • Microservices-Friendly: The project is designed with microservices in mind, making it well-suited for modern, cloud-native applications.
  • Extensible Architecture: ServiceComb Pack has a modular architecture, allowing developers to extend or customize the solution to fit their specific needs.
  • Open-Source and Community-Driven: ServiceComb Pack is an open-source project, with a growing community of contributors and users.

Cons

  • Complexity: Distributed transaction management can be a complex topic, and ServiceComb Pack may have a steeper learning curve for some developers.
  • Limited Documentation: The project's documentation, while improving, could be more comprehensive and user-friendly.
  • Maturity: As an open-source project, ServiceComb Pack may not have the same level of maturity and stability as some commercial solutions.
  • Adoption: Compared to some other distributed transaction management solutions, ServiceComb Pack may have a smaller user base and ecosystem.

Getting Started

To get started with ServiceComb Pack, you can follow the official Quick Start guide. Here's a brief overview of the steps:

  1. Install Prerequisites: Ensure you have Java 8+ and Docker installed on your system.
  2. Clone the Repository: Clone the ServiceComb Pack repository from GitHub:
    git clone https://github.com/apache/servicecomb-pack.git
    
  3. Build the Project: Navigate to the project directory and build the project using Maven:
    cd servicecomb-pack
    mvn clean install
    
  4. Start the Saga Service: Run the Saga service, which is the core component of ServiceComb Pack:
    cd saga-distribution/target
    tar -xvf saga.tar.gz
    cd saga
    ./start.sh
    
  5. Deploy Sample Applications: Deploy the sample applications provided in the repository to test the distributed transaction management capabilities of ServiceComb Pack.

For more detailed instructions and information on configuring and using ServiceComb Pack, please refer to the project's documentation.

Competitor Comparisons

10,038

A distributed transaction framework, supports workflow, saga, tcc, xa, 2-phase message, outbox patterns, supports many languages.

Pros of dtm

  • Supports multiple programming languages (Go, Java, Python, PHP, Node.js)
  • Offers a variety of transaction modes (2PC, Saga, TCC, XA)
  • Provides a simple API and easy integration

Cons of dtm

  • Relatively newer project with a smaller community
  • Less comprehensive documentation compared to ServiceComb-Pack

Code Comparison

dtm:

saga := dtmcli.NewSaga(DtmServer, gid).
    Add(busi.Busi+"/TransOut", busi.Busi+"/TransOutCompensate", &req).
    Add(busi.Busi+"/TransIn", busi.Busi+"/TransInCompensate", &req)
err := saga.Submit()

ServiceComb-Pack:

@SagaStart(policy = "BackoffPolicy")
public boolean transferMoney(String from, String to, int amount) {
    accountService.transfer(from, amount, DECREASE);
    accountService.transfer(to, amount, INCREASE);
    return true;
}

Both projects aim to solve distributed transaction management, but dtm offers more flexibility in terms of language support and transaction modes. ServiceComb-Pack, being an Apache project, has a more established ecosystem and documentation. The code examples show that dtm uses a fluent API style, while ServiceComb-Pack relies on annotations for defining sagas.

3,214

Process Orchestration Framework

Pros of Camunda

  • More comprehensive workflow and decision automation platform
  • Larger community and ecosystem with extensive documentation
  • Supports multiple programming languages and deployment options

Cons of Camunda

  • Steeper learning curve due to its extensive feature set
  • Potentially higher resource requirements for full platform deployment
  • May be overkill for simple microservice orchestration scenarios

Code Comparison

ServiceComb-Pack (Java):

@SagaStart(policy = "BackoffPolicy")
public void bookTrip(String name) {
    carBooking(name);
    hotelBooking(name);
    flightBooking(name);
}

Camunda (Java):

@Autowired
private RuntimeService runtimeService;

public void bookTrip(String name) {
    Map<String, Object> variables = new HashMap<>();
    variables.put("name", name);
    runtimeService.startProcessInstanceByKey("bookTripProcess", variables);
}

ServiceComb-Pack focuses on saga pattern implementation for distributed transactions, while Camunda provides a more comprehensive BPMN-based workflow engine. ServiceComb-Pack uses annotations to define saga steps, whereas Camunda typically uses BPMN diagrams and process definitions. Camunda offers more flexibility in process design and execution but may require more setup and configuration compared to ServiceComb-Pack's lightweight approach.

Flexible framework for workflow and decision automation with BPMN and DMN. Integration with Quarkus, Spring, Spring Boot, CDI.

Pros of Camunda BPM Platform

  • More comprehensive business process management solution
  • Extensive documentation and community support
  • Offers both open-source and enterprise editions

Cons of Camunda BPM Platform

  • Steeper learning curve due to its complexity
  • Potentially heavier resource consumption
  • May be overkill for simpler microservice orchestration needs

Code Comparison

ServiceComb-Pack (Saga implementation):

@SagaStart(policy = "BackoffPolicy")
public boolean transferMoney(String from, String to, int amount) {
    accountService.pay(from, amount);
    accountService.credit(to, amount);
    return true;
}

Camunda BPM Platform (BPMN process):

<bpmn:process id="money-transfer">
  <bpmn:startEvent id="start" />
  <bpmn:serviceTask id="pay" name="Pay" camunda:delegateExpression="${payDelegate}" />
  <bpmn:serviceTask id="credit" name="Credit" camunda:delegateExpression="${creditDelegate}" />
  <bpmn:endEvent id="end" />
</bpmn:process>

ServiceComb-Pack focuses on microservice transaction management using the Saga pattern, while Camunda BPM Platform provides a full-fledged business process management solution. ServiceComb-Pack is lighter and easier to integrate into existing microservice architectures, whereas Camunda offers more advanced features for complex business processes but requires more setup and configuration.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Pack | 中文 Build Status Coverage Status Maven Central License Quality Gate Status Gitter

Apache ServiceComb Pack is an eventually data consistency solution for micro-service applications.

Notice to contributors: this project is not active due to lack of maintainers. If you are interested in this project, please cantact us and we will help you to be a committer.

Notice to users: this project is not active due to lack of maintainers. Before we find enough resources, do not use this project if possible.

Features

  • High availability. The coordinator is stateless and thus can have multiple instances.
  • High reliability. All transaction events are stored in database permanently.
  • High performance. Transaction events are reported to coordinator via gRPC and transaction payloads are serialized/deserialized by Kyro.
  • Low invasion. All you need to do is add 2-3 annotations and the corresponding compensate methods.
  • Easy to deploy. All components can boot via docker.
  • Support both forward(retry) and backward(compensate) recovery.
  • Easy to extend other coordination protocol which is based on the Pack, now we have Saga and TCC support out of box.

Architecture

ServiceComb Pack is composed of alpha and omega.

  • The alpha plays as the coordinator. It is responsible for the management of transactions.
  • The omega plays as an agent inside the micro-service. It intercepts incoming/outgoing requests and reports transaction events to alpha.

The following diagram shows the relationships among alpha, omega and services. Pack Architecture

In this way, we can implement different coordination protocols, such as saga and TCC. See ServiceComb Pack Design for details.

Now we have different lanaguage implementation of Omega

Get Started

  • For ServiceComb Java Chassis application, please see Booking Demo for details.
  • For Spring applications, please see Booking Demo for details.
  • For Dubbo applications, please see Dubbo Demo for details.
  • For TCC with Spring application, please see Tcc Demo for details.
  • To debug the applications, please see Spring Demo Debugging for details.

Build and Run the tests from source

  • Build the source code and run the tests
       $ mvn clean install
    
  • Build the source demo docker images and run the accept tests
       $ mvn clean install -Pdemo
    
  • Build the source code and docker images without running tests, the docker profile will be activated if the maven detects the docker installation.
       $ mvn clean install -DskipTests=true -Pdemo
    
  • Build the release kit for distribution without running the tests, then you can find the release kits in the distribution/target directory.
       $ mvn clean install -DskipTests=true -Prelease
    

User Guide

How to build and use can refer to User Guide.

Get The Latest Version

Get released version:

Get snapshot version:

  • We publish the snapshot version to Apache nexus repo, please add below repositories into your pom.xml.
            <repositories>
              <repository>
                <releases />
                <snapshots>
                  <enabled>true</enabled>
                </snapshots>
                <id>repo.apache.snapshot</id>
                <url>https://repository.apache.org/content/repositories/snapshots/</url>
              </repository>
            </repositories>
            <pluginRepositories>
              <pluginRepository>
                <releases />
                <snapshots>
                  <enabled>true</enabled>
                </snapshots>
                <id>repo.apache.snapshot</id>
                <url>https://repository.apache.org/content/repositories/snapshots/</url>
              </pluginRepository>
            </pluginRepositories>
    
    
    

FAQ

Contact Us

Contributors

contributors

How to Contribute

See Pull Request Guide for details.

License

Licensed under an Apache 2.0 license.

Export Notice

This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information.

The Apache Software Foundation has classified this software as Export Commodity Control Number (ECCN) 5D002, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this Apache Software Foundation distribution makes it eligible for export under the "publicly available" Section 742.15(b) exemption (see the BIS Export Administration Regulations, Section 742.15(b)) for both object code and source code.

The following provides more details on the included cryptographic software:

  • Omega/Alpha Transport can be configured use https