Primitive types
Primitive types are the fundamental data types that can be stored in a collection type. Currently, the only supported collection type is a LiveMap. LiveObjects supports the following primitive types:stringnumber(double-precision floating-point)booleanbytes- JSON arrays or objects
Object types
LiveObjects provides specialized object types to model your application state. These object types are designed to be conflict-free and eventually consistent, meaning that all operations on them are commutative and converge to the same state across all clients.LiveMap
LiveMap is a key/value data structure similar to a dictionary or JavaScript Map:- Keys must be strings
- Values can be primitive types, JSON-serializable objects or arrays, or references to other objects
- Supports
setandremoveoperations - Concurrent updates to the same key are resolved using last-write-wins (LWW) semantics
LiveCounter
LiveCounter is a numeric counter type:- The value is a double-precision floating-point number
- Supports
incrementanddecrementoperations
Channel object
The channel object is a specialLiveMap instance which:
- Implicitly exists on a channel and does not need to be created explicitly
- Has the special objectId of
root - Cannot be deleted
- Serves as the entry point for accessing all other objects on a channel
channel.object.get(), which returns a PathObject that resolves to the root LiveMap:
Composability
LiveObjects enables you to build complex, hierarchical data structures through composability. Specifically, a LiveMap can store references to otherLiveMap or LiveCounter object instances as values. This allows you to create nested hierarchies of data.
Reachability
All objects must be reachable from the channel object (directly or indirectly). Objects that cannot be reached from the channel object will eventually be deleted. When you replace or remove an object reference, it may become unreachable and will eventually be deleted:Metadata
Objects include metadata that helps with synchronization, conflict resolution and managing the object lifecycle.Object IDs
Every object has a unique identifier that distinguishes it from all other objects. You can access an object’s ID using the Instance API:Tombstones
Tombstones are markers indicating an object or map entry has been deleted.- A tombstone is created for an object when it becomes unreachable from the channel object.
- A tombstone is created for a map entry when it is removed
