当前位置:网站首页>Applicable scenario of multi-master replication (2) - client and collaborative editing that require offline operation
Applicable scenario of multi-master replication (2) - client and collaborative editing that require offline operation
2022-07-31 15:32:00 【HUAWEI CLOUD】
3.1.2 Clients requiring offline operation
Apps need to continue working after disconnection.
Calendar applications such as mobile phones, PCs and other devices.Always check whether your device is currently connected or not:
- Current meeting agenda (read request)
- Add new meeting (write request)
Any changes made while offline will be synced with the server and other devices the next time the device comes online.
At this point, each device has a local DB that acts as M (accepts write requests), and synchronizes these replicas on multiple Ms in an asynchronous manner among all devices. The synchronization lag may be several hours or days.The exact time depends on when the device is back online.
Architecturally, this setup is similar to multi-master replication between IDCs, except that each device is an "IDC" and the network connection between them is extremely unreliable.It can also be seen from these broken implementations of the calendar synchronization function that multiple masters can get results, but there are still many unknowns in the middle.
There are tools designed to make multi-master configuration easier, such as CouchDB.
3.1.3 Collaborative Editing
The real-time collaborative editing application allows multiple people to edit documents at the same time.Such as Google Docs.Collaborative editing is usually not fully equivalent to a database replication problem, but it is similar to the offline editing case mentioned earlier.
When one user edits a document, the changes are immediately applied to the local copy (document state in a web browser or client application) and asynchronously replicated to the server and any other users editing the same document.
To guarantee no editing conflicts, the application must lock the document before editing.If another user wants to edit the same document, it must wait until the first user commits the changes and releases the lock.This collaboration model is similar to the master-slave replication model where transactions are executed on the master node.
In order to speed up the collaboration efficiency, it is expected that the editable granularity is set to be small, such as one button or even the whole process of unlocking.But it also brings a challenge that multi-master replication has: resolving conflicts.
边栏推荐
猜你喜欢
随机推荐
三、数组
"Autumn Recruitment Series" MySQL Interview Core 25 Questions (with answers)
Gorm—Go language database framework
Visualize GraphQL schemas with GraphiQL
Implementing click on the 3D model in RenderTexture in Unity
TextBlock控件入门基础工具使用用法,取上法入门
工程水文学名词解释总结
Matlab矩阵基本操作(定义,运算)
Vb how to connect mysql_vb how to connect to the database collection "advice"
Public Key Retrieval is not allowed error solution when DBeaver connects to MySQL 8.x
mysql black window ~ build database and build table
为什么毕业季不要表白?
Kubernetes常用命令
长得很怪的箱图
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化箱图、使用font函数自定义图例标题文本(legend.title)字体的大小、颜色、样式(粗体、斜体)
多主复制的适用场景(1)-多IDC
Grafana安装后web打开报错
leetcode303场周赛复盘
Word table to Excel
Destruction order of thread_local variables