seata Extend the SQL and resources supported by the AT transaction mode

xhv8bpkk  于 2022-12-31  发布在  其他
关注(0)|答案(9)|浏览(372)

Proposal:Extend the SQL and resources supported by the AT transaction mode

Currently, Seata AT transaction mode supports limited SQL statements and databases (MySQL, Oracle, PostgreSQL, TiDB). We hope to extend more types of complex SQL statements and support more relational database resources or other types of resources including but not limited to MQ, NoSQL, etc.
• extend support for at least one relational database, MQ, or NoSQL resource.
• extended complex SQL support for AT schema.

扩展AT模式的SQL和资源支持
目前 Seata 的 AT 事务模式支持有限的 SQL 语句和数据库(MySQL、Oracle、PostgreSQL、TiDB),我们希望能扩展更多类型的复杂 SQL 语句和支持更多的关系数据库资源亦或者其他类型的资源包括但不限于 MQ、NoSQL 之类。
• 至少扩展支持一种的关系型数据库、MQ或者 NoSQL 资源。
• 扩展AT模式的复杂SQL支持。

mentor: Ji Min @slievrly, Seata project Maintainer

zazmityj

zazmityj1#

I found project Seata really interesting and I am looking forward to work on this issue during the ASoC 2020. I would like to know what are the next steps and Is there any community platform/mailing list dedicated for ASoC 2020 where we can discuss on the issue further?

idv4meu8

idv4meu82#

@rpjayasekara We welcome you to participate in the ASOC, if you expect to further communication with us can reply directly or subscribe to the group email dev-seata+subscribe@googlegroups.com .

tp5buhyn

tp5buhyn3#

@rpjayasekara

  • For complex SQL support, you need to understand [druid] ( https://github.com/alibaba/druid ) to parse SQL. The sqlparser module in Seata is responsible for providing SQL parsing tools, and the rm-datasource module is responsible for SQL parsing and generating rollback recording.
    reference:
    druid

针对复杂SQL支持,你需要了解一下 druid 解析SQL,Seata中sqlparser模块负责提供SQL解析工具,rm-datasource模块负责中SQL解析,并且生成回滚记录。
参考:
druid

  • For the extended relational database, or MQ, NOSQL, if you choose to support the new relational database, then you need to understand the syntax of the new relational database and support for the SQL standard. For specific implementation, please refer to the implementation method of the MySQL database in Seata, But need to pay attention to some of the characteristics of the new relational database itself. If you choose to support MQ, You need to choose an MQ middleware, such as (RocketMQ, RabbitMQ, etc.), if you choose to support NoSQL,You need to choose a NoSQL database, such as (Redis, MongoDB, etc.) and use the java client implementation it provides.
    reference:
    Apache RocketMQ
    rabbitmq-java
    jedis
    mongo-java

针对扩展关系型数据库,或者MQ,NOSQL,如果选择支持新的关系型数据库,那么你需要了解新关系型数据库的语法,以及对SQL标准的支持情况,具体实现可以参照Seata中MySQL数据库的实现方法,不过需要注意新关系型数据库自身的一些特性。如果选择对MQ进行支持,你需要选择一种MQ中间件,例如(RocketMQ,RabbitMQ等),如果选择对NoSQL进行支持,你需要选择一种NoSQL的数据库,例如(Redis, MongoDB等)并使用它提供的java客户端实现。
参考:
Apache RocketMQ
rabbitmq-java
jedis
mongo-java

1tu0hz3e

1tu0hz3e5#

I would like to add MongoDB support for the Seata as at the moment Seata has no NoSQL DB implementations in AT transaction mode. Is there any implementation design documents like project architecture to understand the implementation of the Seata. I have some confusions of understanding the project.

uqdfh47h

uqdfh47h8#

Which branch should I work on?

cvxl0en2

cvxl0en29#

Q.对最终一致性分布式事务如何保障实际生产中高可用?
对于常见的微服务系统,大部分接口调用是同步的,也就是一个服务直接调用另外一个服务的接口.但是在实际系统的开发中,可能服务间的调用是异步的。也就是说,一个服务发送一个消息给 MQ,
比如 RocketMQ、RabbitMQ等,另外一个服务从 MQ 消费到一条消息后进行处理其实就成异步处理了。针对这种基于MQ的异步调用,如何保证各个服务间的分布式事务和高可用?

A:我的大致思路是这样:
	1.上游服务投递100%可靠消息
		上游服务发送一条消息给可靠消息服务,可靠消息服务把消息存储到自己的数据库里去,状态为“待确认”。如果本地数据库执行成功,则确认发送可靠消息,数据库改为“已发送状态”、反则删除消息,此时本地数据库必须和消息保持在一个事务内。
		如何保证100%可靠消息如果本地数据库一直为待确认,但是mq发送可靠消息失败,使用job检查消息的状态,若成功则修改本地事务状态,并且投递MQ
	2.下游服务100%接收服务
		如果下游服务消费消息出了问题,没消费或者是对消息的处理失败了,也用job检查消息状态,如果消息一直是“已发送”而不是“已完成”,上游服务会再次投递消息让下游去处理,但是下游服务得去重保持幂等保证只处理一次消息
		
	3.用redis队列支持高并发降级	
		1.业务触发mq事故,引发降级,如何引发降级
		2.mq发生事故,可靠消息通过hash写入key,val
		3.下游服务,感知降级,从redis获取数据
		3.使用job定时去检查故障是否恢复,如果恢复关闭降级

Q.Saga涉及太多服务调用的话,就不太友好了,将流程管理器添加为协调器,是否可用RocketMq顺序消费

相关问题