Skip to content
Framework for building collaborative editing applications
Go Other
  1. Go 98.9%
  2. Other 1.1%
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
api
client
cmd
pkg
testhelper
yorkie
.gitignore
Dockerfile
Makefile
README.md
docker-compose.yml
go.mod
go.sum
main.go

README.md

Yorkie

Yorkie is a framework for building collaborative editing applications.

  • Optimistic replication style system that ensures eventual consistency
  • Providing real-time synchronization and offline editing
  • Using the JSON-like document(CRDT) as the basic data type
  • Stored documents can be searchable then the documents can be editable after attaching

How Yorkie works

 +--Client "A" (Go)----+
 | +--Document "D-1"-+ |               +--Agent------------------+
 | | { a: 1, b: {} } | <-- Changes --> | +--Collection "C-1"---+ |
 | +-----------------+ |               | | +--Document "D-1"-+ | |      +--Mongo DB---------------+
 +---------------------+               | | | { a: 1, b: {} } | | |      | Changes                 |
                                       | | +-----------------+ | | <--> | Snapshot with CRDT Meta |
 +--Client "B" (JS)----+               | | +--Document "D-2"-+ | |      | Snapshot for query      |
 | +--Document "D-1"-+ |               | | | { a: 1, b: {} } | | |      +-------------------------+
 | | { a: 2, b: {} } | <-- Changes --> | | +-----------------+ | |
 | +-----------------+ |               | +---------------------+ |
 +---------------------+               +-------------------------+
                                                    ^
 +--Client "C" (JS)------+                          |
 | +--Query "Q-1"------+ |                          |
 | | db.['C-1'].find() | <-- MongoDB query ---------+
 | +-------------------+ |
 +-----------------------+
  • Clients can have a replica of the document representing an application model locally on several devices.
  • Each client can independently update the document on their local device, even while offline.
  • When a network connection is available, Yorkie figures out which changes need to be synced from one device to another, and brings them into the same state.
  • If the document was changed concurrently on different devices, Yorkie automatically syncs the changes, so that every replica ends up in the same state with resolving conflict.

Agent and SDKs

Internals

You can’t perform that action at this time.