傳統系統架構模式為應用程式直接存取資料庫, 這樣的架構特點是直覺方便.
但隨著資料量不斷增大, 會遇到一些問題:
遇到上述問題時, 增加硬體效能垂直擴展可已解決眼前的問題.
不過當業務量不斷累積, 同樣的問題會不斷重現, 而硬體規格是有極限的.
此時只能採用水平擴展的方式來平行化服務負載.
增加新的機器, 把資料庫放在不同機器上, 在應用程式和資料庫之間加一個 Proxy 進行路由管理.
這個 Proxy 即為 MySQL 中間層.
RDS (SQL) with ACID guarantees, and NoSQL-like scalable performance for OLTP workloads.
Vitess is a database clustering system for horizontal scaling of MySQL through generalized sharding.
Provide a mechanism to support atomic commits for distributed transactions across multiple Vitess databases. Transactions should either complete successfully or rollback completely.
2PC introduced the prepare protocol to defend against the above three. A database that acknowledges a prepare must give you the following guarantees:
2PC transactions guarantee atomicity: either the whole transaction commits, or it’s rolled back entirely. It does not guarantee Isolation (in the ACID sense).
Guaranteeing ACID Isolation is very contentious and has high costs. Providing it by default would have made vitess impractical for the most common use cases.
TiDB is an open-source, cloud-native, MySQL-compatible distributed database that handles hybrid transactional and analytical processing (HTAP) workloads.
MySQL 中間層
Vitess
TiDB
Misc