Presentation on how to chat with PDF using ChatGPT code interpreter
History Of Redis Replication And Future Prospects: Zhao Zhao
1. PRESENTED BY
History of Redis replication and
future prospects
Zhao Zhao
@solostoy
Alibaba Cloud, senior engineer
2. • Redis in Alibaba Cloud
• Redis replication history
• Redis replication prospect
• Replication based on AOF
• Multi-active Redis
3. Standard Ali-Cluster Split-rw
Redis Mode Stand-alone Stand-alone Stand-alone
High Availability Yes Yes Yes
Proxy No Yes Yes
Scalable Up Up & Out Up & Out
Read/Write Splitting No No Yes
Redis in Alibaba Cloud
4. • Simple architecture
• Easy to use
• High availability
• Full compatibility
VIP
Client
replication
master replica
HA
Standard
5. • Proxy based cluster
• Easy to use
• High availability
• Good compatibility
VIP
Client
Proxy Proxy Proxy
master
replica
master
replica
master
replica
HA
CS
Ali-Cluster
6. • Replication chain
• Easy to use
• High availability
• Full compatibility
VIP
Client
Proxy Proxy Proxy
master read-only
replica
read-only
replica
HA
CS
Split-rw
15. • New features
• Run ID
• Random ID like process ID
• Replication offset
• Record the replication status
• Replication backlog
• Cache the replication data
master
replica
replication
master client: run_id: ABC
reploff: 123
· run_id: ABC
· repl_offset: 123
· run_id: ?
· repl_offset: ?
replication backlog
PSYNC
21. • New features
master
replica
replication
master client: repl_id: ABC
reploff: 123
· repl_id: ABC
· repl_offset: 123
· repl_id: ABC
· repl_offset: 123
replication backlog
replication backlog
• Replication ID
• Same in replication chain
• Replication ID2/offset2
• Record the previous replication ID and offset
• Replica works as a proxy
• Replica just transfer data from master
• Saving replication info in RDB
• RDB contains replication ID and offset
PSYNC2
27. • Next improvements to Redis replication
https://github.com/antirez/redis/issues/4357
• AOF annotations
• AOF contains replication infomations
• Detecting reboot instances as failing
• Check run id to failover
• Replica ability to reconnect master with partial sync
• Same as PSYNC2
PSYNC3
37. • OPGET & OPAPPLY
middle ware
OPGET from A OPAPPLY to B
OPGET from BOPAPPLY to A
• OPGET <server_id> <op_id> <count>
• Get n commands from op_id with server_id in AOF
• OPAPPLY
• Give this client a special mark
Multi-active
38. • Avoid cycle
server_id op_id src_opid cmd
A 100 -1 Cmd1
server_id op_id src_opid cmd
B 20 -1 Cmd2
server_id op_id src_opid cmd
A 100 -1 Cmd1
B 101 20 Cmd2
server_id op_id src_opid cmd
A * -1 Cmd1
server_id op_id src_opid cmd
B 19 -1 Cmd1
Multi-active
39. • Conflict
SET key value1
SET key value2 SET key value3
• Conflict Solution
• Users POV - avoid conflict
• Using different DB
• Keys with different prefix
• CRDT - solve conflict
• Most data structures satisfy
• It’s on the way, but it is not the Silver Bullet
Multi-active
40. Open Source & Alibaba Cloud
https://github.com/alibaba/ApsaraCache
https://www.alibabacloud.com/product/apsaradb-for-redis
https://github.com/alibaba/RedisShake