关键字:
KFS, Tungsten Replicator
Tungsten Replicator概述
Tungsten Replicator™ is a replication engine supporting a variety of different extractor and applier modules. Data can be extracted from MySQL, Amazon RDS MySQL, Amazon Aurora and Google Cloud SQL, and applied to a variety of transactional stores, NoSQL stores and datawarehouse stores.
During replication, Tungsten Replicator assigns data a unique global transaction ID, and enables flexible statement and/or row-based replication of data. This enables data to be exchanged between different databases and different database versions. During replication, information can be filtered and modified, and deployment can be between on-premise or cloud-based databases. For performance, Tungsten Replicator™ provides support for parallel replication, and advanced topologies such as fan-in, star and multi-master, and can be used efficiently in cross-site deployments.
Routing概述
路由方式会影响客户端和数据库的连接方式,并且控制连接器(connector)对连接和statement的检测程度。通过自动对客户端连接的路由转发,可以实现对恰当服务器的连接和负载均衡以及读写分离。
Routing Method
3.1 主备节点选择
RO_RELAXED设置可以以只读额形式转发query到Replica,但在没有Replica的情况下选择PRIMARY
RW_STRICT设置表示语句是Write行为,应该被转发到PRIMARY节点
3.2 连接器负载均衡
DefaultLoadBalancer:永远选择PRIMARY
MostAdvancedSlaveLoadBalancer:选择复制最多event数量的replica
LowestLatencySlaveBalancer:选择延迟最低的replica
RoundRobinSlaveLoadBalancer:以RR算法选择replica
Smart Scale Routing
智能管理读写请求,实现读写分离和严格的读写consistency,但会消耗更多的性能。
如果需要立刻获取刚刚写入的信息,使用smart route。
如果读取需求可以容忍相对落后的脏数据,请使用direct mode。
Direct Routing
Smart routing的简化版本,提供更高效率的读写分离系统,但是不考虑consistency。
适合少量写入,大量读取的业务场景。
SQL Routing
根据SQL语句进行路由,无法进行自动读写分离和主备选择。
Host Routing
通过不同的host端进行读写分离转发,无法和smartscale同时启用,必须在PRIMARY执行。
参考资料
http://help.kingbase.com.cn/