1、基于MGR的读写强一致性数据库p 现实问题p 写一致性p 读一致性p 规划和展望目录Contents1PART ONEWhat s the reality ?2PART TWOWrite Consistency分布式数据库的核心能力02. Fault-Tolerant01. Scalability可以容忍实例、机器、存储和网络的异常弹性的扩展能力010203. Write ConsistencyCluster数据一旦写入成功,不会丢失Multiple replicas05. Availability0503保证99.99%的可用性04. Read Consistency04保证数据读取的线性一
2、致性写一致性Replicated State MachineConsensus Protocol为什么选择MySQL Group Replication01. Consensus Protocol02. StabilityMencious (Paxos variant)保证线性一致性官方支持社区生态完善全局同序处理MGRMySQL GroupReplication03. Multiple Primary04. Focus多点写入读取的线性一致性完善一致性语义提升可用性3PART THREERead ConsistencyMGR的架构和复制方式读一致性 read-your-writes cons
3、istency monotonic-reads consistent prefix reads01. Proxy Route02. Read convert Write读转换为写走一遍Paxos协议通过Proxy流量调度的方式HOW记录写入点读取时携带写入点W + R NDrawer Principle推进到写入点后下放读03. Quonum Read04 Read with Write-Point05 all sync + read wait until commit读一致性1234第一阶段第二阶段读一致性读一致性ConclusionMake simpleappear as only one
4、 copy of data日志的一致性MTS性能Single-Pirmary Throughput: Sysbench OLTP RW 1 IDCSingle-Pirmary Throughput: Sysbench OLTP RO 1 IDC20000150000100000500000180001600014000120001000080006000400020000Group ReplicationConsistent R eadGroup ReplicationConsistent R eadSingle-Pirmary Throughput: Sysbench OLTP RW 2 I
5、DCSingle-Pirmary Throughput: Sysbench OLTP RO 2 IDC14000120001000080006000400020000120000100000800006000040000200000Group ReplicationConsistent R eadGroup ReplicationConsistent R ead最佳实践内存使用冲突检测库,在途事务,恢复时对增量数据的缓存Paxos消息缓存,writesets开销节点管理失败节点重新加入3+1容灾读一致性错误节点摘除读流量开启流量控制、大事务限制4PART FOURBlueprint规划和展望Optimization冲突检测库的gc优化内存容量管理1234writesets版本Multiple Primary多写试点整合一致性读跨机房优化Enhance Consistency Read优化性能提前回放版本管理Port with MySQL 8.0.14一致性增强自动rejoin指定主库