How DingTalk’s Collaborative Engine Enables Real‑Time Multi‑Device Sync
The article introduces DingTalk’s Collaborative Engine—a cross‑platform runtime and framework that solves distributed data consistency, enabling real‑time multi‑person collaboration, cross‑device synchronization, and offline‑first capabilities while offering Backend‑as‑a‑Service for developers.
What Is the Collaborative Engine?
The Collaborative Engine is DingTalk’s cross‑platform runtime and development framework that solves distributed data consistency for real‑time collaboration.
Key Scenarios
Multi‑person real‑time collaboration
Cross‑device synchronization and application state hand‑off
Offline‑first capability
It is also open to third‑party developers (mini‑programs, H5 apps).
Demo: Real‑time Annotation
Since DingTalk client 6.0.0, image messages support “Together Annotate”, allowing multiple users to draw on the same picture simultaneously. The SDK provides a CoCanvas component that renders the collaborative canvas and reports participant information such as “how many people are annotating”.
Demo: Cross‑Device Sync (Chat Draft)
Users often edit content on a phone and want to continue on a computer. The engine enables end‑to‑end input synchronization, so the draft is instantly available on the other device without manual transfer.
Open‑Platform Benefits for Third‑Party Apps
Write once, run on multiple platforms (mobile, desktop)
Desktop large‑screen productivity
Multi‑person task collaboration
Cross‑device hand‑off
Local‑first offline support
Backend‑as‑a‑Service (BaaS) – developers only write front‑end code
Core Concepts
The engine provides collaborative data structures (CDS) such as CoString , CoBoolean , CoMap , CoList , and higher‑level types like CoText (OT‑enabled text) and CoPixel (graphic annotation).
Data is organized in a Container , a collection of CDS objects that can reference each other.
API Example
Container container = Loader.getContainer(url);
CoCounter counter = container.getCoCounter("my_counter");
// 点击+1按钮时
counter.add();
// 监听数据变化
counter.addEventListener(new CoCounterValueChangedListener() {
@Override
public void onValueChanged(int newValue) {
// 更新UI
updateView(newValue);
}
});Architecture Overview
The client side consists of several layers:
Platform – native APIs for each OS
API – cross‑platform glue layer
Loader – singleton that loads Containers
Container – core module managing CDS and runtime processes
Service – interfaces to platform capabilities
Provider – platform‑specific implementations of Service
Server Side
The server handles connection and session management, message broadcasting, ordering, persistence, and operation transformation.
Weak‑Network and Offline Optimization
The engine includes a PendingQueue that caches unconfirmed local operations. Operations are stored locally, sent in order, and retried until the server acknowledges them, ensuring data is never lost even on unstable networks.
Conclusion
The Collaborative Engine provides a unified solution for real‑time multi‑person, cross‑device collaboration, offline‑first reliability, and BaaS capabilities, allowing developers to focus on business logic while the engine handles synchronization, conflict resolution, and network variability.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
