Concepts
Here we outline some of the high level concepts that make apps work in the coviu ecosystem
Resources
A resource can be thought of as an instance of an app. In a call you can have multiple resources open, and you can generally have multiple resources of the same app open at the same time with their own state. Resources are segregated from each other and can have their own state which can either be controlled per client using a Resource Cache, or they can have synced state using the mesh.
Resource Cache
A resource cache is where you will store local data for an app. Typically a resource will create a cache as part of the app instantiation which will be tied to the resource.id. This cache will then persist data for the app if users change active apps in the call. A resource cache is entirely local to each participant in a call, so an app running in one persons browser will have no influence on another persons cache state
Call Mesh
The call mesh is a method of keeping state synchronised across all participants in a call. Our mesh implementation uses conflict-free replicated data type
or CRDT
to allow for eventually consistent data across all participants. The mesh in a call encompasses a lot of shared data, but from an apps perspective you'll only be managing the mesh state for resources instances of your app.
The call mesh is useful for data that you need to keep in sync across all participants in a call. It is also useful for state that you want new participants to have access to when they join a call.
The call mesh is not useful for data that changes frequently or rapidly as it uses a replay mechanism to get participants up to the latest state and can have severe performance implications. If you need fast real time data sharing then consider using Data Streams.
An example of the call mesh being used can be seen in our app examples repo: https://github.com/coviu/coviu-addons/tree/master/incall-mesh-syncing
Data Streams
Data streams are useful if you need to frequently update participants with data that would otherwise overwhelm the call mesh. Data streams are peer to peer and care needs to be taken if you're expecting the state to be synced across participants.
An example of data stream being used can be seen in our app examples repo: https://github.com/coviu/coviu-addons/tree/master/incall-datastream
Updated 3 months ago