当前位置:网站首页>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.
边栏推荐
- R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化分组箱图、使用ggpar函数改变图形化参数(caption、添加、修改可视化图像的题注、脚注内容)
- 复制延迟案例(3)-单调读
- [MySQL] Mysql paradigm and the role of foreign keys
- 第二届中国PWA开发者日
- Linux查看redis版本(查看mongodb版本)
- TRACE32 - C source code association
- Deployment应用生命周期与Pod健康检查
- 工程流体力学复习
- Ubantu专题5:设置静态ip地址
- Efficient use of RecyclerView Section 1
猜你喜欢
随机推荐
Precautions and solutions when SIGABRT error is reported
Deployment应用生命周期与Pod健康检查
工程水文学试卷
定时器的类型
Snake Project (Simple)
type of timer
Female service community product design
Implementing click on the 3D model in RenderTexture in Unity
数据库的范式(第一范式,第二范式,第三范式,BCNF范式)「建议收藏」
BGP综合实验(建立对等体、路由反射器、联邦、路由宣告及聚合)
做事软件开发-法的重要性所在以及合理结论的认识
基于ABP实现DDD
Excel快速对齐表格的中姓名(两个字姓名和三个字姓名对齐)
浏览器自带的拾色器
R语言计算时间序列数据的移动平均值(滚动平均值、例如5日均线、10日均线等):使用zoo包中的rollmean函数计算k个周期移动平均值
R language test whether the sample conforms to normality (test whether the sample comes from a normally distributed population): shapiro.test function tests whether the sample conforms to the normal d
Word表格转到Excel中
The principle of hough transform detection of straight lines (opencv hough straight line detection)
MySQL的相关问题
Ubantu project 4: xshell, XFTP connected the virtual machine and set xshell copy and paste the shortcut