DEV Community

小猫先生
小猫先生

Posted on

2

分布式事务

eBay 的 Dan Pritchard 提出的 BASE 原则与传统数据库的 ACID 意思不同。在不同事件发生时,业务状态可能在短时间内与事件结果不一致。

BASE 原则

  • 基本可用 Basically Available
  • 软状态 Soft state
  • 最终一致 Eventually consistent

CP vs AP

  • 强一致
  • 弱一致/最终一致
  • 本地事务 + 异步消息 + 重试 + 幂等 => 最终一致性

ByteTCC 框架

  • 支持 Spring 容器的声明式事务管理
  • 支持普通事务、TCC 事务、业务补偿型事务等事务机制
  • 支持多数据源、跨应用、跨服务器等分布式事务场景
  • 支持长事务
  • 支持 dubbo 服务框架
  • 支持 spring cloud
  • 提供框架层面的幂等性解决方案

事件+消息

(来源:这里
分布式事务事件消息
分布式事务2

参考

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more