最近在关注这个  
张总有微信么 

我加您:)



分布式链 冯德军
tel:15221883040
 
From: zhangli...@apache.org
Date: 2018-06-06 12:21
To: dev
Subject: Discuss for integrate with saga and sharding-sphere
Hello servicecomb devs,
 
I want discuss for how to integrate with saga and sharding-sphere.
 
1. Split saga as service scope and RDB scope. Service scope still use
annotation to associate compensation method, RDB scope can generate
reverted SQL and data snapshot automatically. Alpha can use revert SQL and
previous data snapshot to compensate automatically, do not need end users
provide additional cancel method.
 
2. Sharding-Sphere can generate reverted SQL and data snapshot:
INSERT SQL will revert to DELETE SQL with primary key and sharding key.
UPDATE/DELETE SQL will generate SELECT SQL and save data snapshot first,
and then use UPDATE OR INSERT to compensate data.
Saga may need to change data structure for receive SQL and data snapshot,
maybe use json format to save on payload field is a good idea.
 
3. Sharding-Sphere use guava's eventBus to post DML event. Sharding-Sphere
plan to add 2 listeners, one is just save reverted SQL and snapshot, other
is for send correct info to Omega.
 
4. For version of data modification, just guarantee by end user right now,
in future we can consider about use additional version field or shadow
table to handle it.
 
Best regards,
Zhang Liang

Reply via email to