Skip to main content

What both modes share

The server–client and the relay mode store and merge in different places, but most of the package is the same for both. The pages of this group apply whatever mode you picked.

PageWhat it coversNotes per mode
Server frameworksserve the sync from Dart Frog or Serverpod: routes, authentication, lifecycleone section per mode: server–client, relay
Plugins and awarenessextend the client and the server; presence and remote cursorsa relay rebroadcasts awareness and stores none of it
Connection and errorsconnection status, reconnection, liveness, the data that did not make it inthe relay client retries forever, with backoff
Versions and compatibilitythe handshake, what it refuses, the wire formata relay checks the protocol version only
Compressionplug a compressor into the clients and the serversa relay in another language must decode it too
Custom transportthe protocol on a transport you do not own, or one the host bindsDocumentSessionHost or RelaySessionHost

Also shared:

  • The client side of an app. CRDTReplica opens the document, its storage and its client in the right order, with a WebSocketClient or a WebSocketRelayClient.
  • The wire format and the plugin system. Each mode has its own range of message type codes (see Wire format).
  • The offline rule. Open the document from its storage before you connect, and the client sends whatever the server is missing.