apache / servicecomb-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 .
https://servicecomb.apache.org/
Apache License 2.0
1.93k stars 437 forks source link

对pack的几点述求 #692

Open kelly-ye opened 3 years ago

kelly-ye commented 3 years ago

1、springboot框架还是比较大的,想只基于spring开发,是否可以剥离springboot框架 2、使用的中间件,如:Kafka、缓存、数据库是否可以提供接口,由业务方进行适配实现接口进行对接 3、当前很多场景是通过异步回调的方式来判断分支事务是否结束,不是同一个线程,怎么在回调方法里面来告诉alpha事务的结果 4、一个分支事务会增加时延几十毫秒甚至上百毫秒,性能需要再优化

zhfeng commented 3 years ago

Thanks @kelly-ye to bring these suggestions. It could be better if you can describe them in English and I think it could be much helpful for more people.

  1. I agree that we need to consider getting out of the spring-boot framework and might provide the core capabilities building on the different runtime vendors, such as the spring, spring-boot or CDI (maybe others). So I think this could be very useful to extend Saga in the different runtime environments. And yeah, this is really a big refactoring on the current codes. I'd like to create a new experimental branch for these changes and see more feedbacks from the community.
  2. It's a good idea to priovde the SPI for these components.
  3. I think we have some discuss about the async invoking of Saga before
coolbeevip commented 3 years ago

Spring Boot components are used in the following places

In Actor mode (saga)

  1. Use spring boot data Elasticsearch for the persistence of completed transaction data

About Channel Model(redis queue or kafka queue)

  1. When alpha receives gRPC events, push to Redis queue(spring boot data redis)

In DB mode(saga or tcc)

  1. Use spring boot data JPA

Alpha UI

  1. Use spring boot Thymeleaf for UI 2.Use spring boot WebSocket for push indicator data to the Alpha UI

  2. Non-state machine mode uses spring boot data jpa

  3. The spring cloud component is also used to realize the registration of some third-party registration centers, eureka, nacos

kelly-ye commented 3 years ago

Thank you @zhfeng for your reply,

  1. How to handle the asynchronous invoking of the Saga?
  2. In Akka mode, whether the actor status can be persisted to the database. Currently, the actor status is persisted to the Redis. However, if the Redis is unreliable, data will be lost, which may cause the actor to fail to be restored.
zhfeng commented 3 years ago

Thank you @zhfeng for your reply,

  1. How to handle the asynchronous invoking of the Saga?

I think it depends on the async framwork you use, such as java concurrency future, vertx, etc. I can not find the discussion on the github issues but maybe on the gitter, @WillemJiang can you recall ?

  1. In Akka mode, whether the actor status can be persisted to the database. Currently, the actor status is persisted to the Redis. However, if the Redis is unreliable, data will be lost, which may cause the actor to fail to be restored.

I think there is an issue for the redis cluster and persistent.

chanjarster commented 3 years ago

@zhfeng I guess you are looking for this: https://lists.apache.org/thread.html/33aa0d9827cf10933796971ebe20cd47205fac8011fba32c5d03a222%40%3Cdev.servicecomb.apache.org%3E

zhfeng commented 3 years ago

Thanks @chanjarster and yeah, this is exactly I want to work out. OK, it looks like a good opportunity to revisit our saga framework to support the async or reactive programming model at this time.

LLLLimbo commented 3 years ago

Could use RocksDB as storage ,and use raft protocol replicating data across machines. Also , Quarks mighte be substitute of Spring.

Current running state can be kept in memory on the leader , and on disk in RocksDB See Zeebe