当前位置:网站首页>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包的ggmaplot函数可视化MA图(MA-plot)、font.legend参数和font.main参数设置标题和图例字体加粗
- 贪吃蛇项目(简单)
- ASP.NET Core generates continuous Guid
- 做事软件开发-法的重要性所在以及合理结论的认识
- Destruction order of thread_local variables
- JVM参数解析 Xmx、Xms、Xmn、NewRatio、SurvivorRatio、PermSize、PrintGC「建议收藏」
- Delete the disk in good condition (recovery partition)
- 浏览器自带的拾色器
- 第二届中国PWA开发者日
猜你喜欢

How useful is four-quadrant time management?

Synchronized和volatile 面试简单汇总

"Autumn Recruitment Series" MySQL Interview Core 25 Questions (with answers)

WPF项目--控件入门基础用法,必知必会XAML

Kubernetes principle analysis and practical application manual, too complete

使用 GraphiQL 可视化 GraphQL 架构

leetcode303场周赛复盘

Female service community product design

Excel快速对齐表格的中姓名(两个字姓名和三个字姓名对齐)

全新宝马3系上市,安全、舒适一个不落
随机推荐
微信聊天记录中搜索红包
Unity中实现点选RenderTexture中的3D模型
Efficient use of RecyclerView Section 3
Linux check redis version (check mongodb version)
多主复制的适用场景(2)-需离线操作的客户端和协作编辑
mysql黑窗口~建库建表
R语言检验样本是否符合正态性(检验样本是否来自一个正态分布总体):shapiro.test函数检验样本是否符合正态分布(normality test)
第二届中国PWA开发者日
RecyclerView高效使用第二节
全新宝马3系上市,安全、舒适一个不落
Delete table data or clear table
Codeforces Round #796 (Div. 2) (A-D)
JVM parameter analysis Xmx, Xms, Xmn, NewRatio, SurvivorRatio, PermSize, PrintGC "recommended collection"
Emmet syntax
update data table update
After Grafana is installed, the web opens and reports an error
Synchronized和volatile 面试简单汇总
Codeforces Round #796 (Div. 2)(A-D)
TRACE32 - SNOOPer-based variable logging
ES6 类