atRecord
The format atServers use to store and share data.
Last updated
The format atServers use to store and share data.
Last updated
© 2023 Atsign
At Atsign, whenever we mention the word "key" we are normally talking about a cryptographic key.
The main exception being the atKey, this is the "key" of a "key value pair" that makes up every atRecord.
It's unfortunate that the word "key" is polymorphic in computer science, and we have tried in the past to move to other words, but we have decided to stick with keys and the developer will have to understand the context of cryptographic key or key value pair (sorry!)
atRecords are the data records that are stored by the atServers. We use the common key-value pair format.
An atKey is the identifier half of the "key-value" pair. Similar to the primary key of a tabular database, the atKey must be a unique string which represents the data.
There are 5 different types of an atKey.
Type | Purpose |
---|---|
A marker for whether it is a cached key or not.
A marker for who has access to the key.
A unique string used to represent the atRecord.
The owner (i.e. creator's) atSign for that particular atRecord. The shared by atSign of an atRecord is synonymous to the owner atSign of an atRecord.
Metadata of the atRecord is also stored and describes the following properties of the atValue.
Text or binary values can be saved in an atServer.
Small objects are fine to use the atServer but large objects should be used by reference.
For example, derive a new encryption key, encypt a file, upload that file to location, then notify other atSigns of the location and the encyption key. This is how atmospherePro works.
The size of the value saved in an atServer is bound by the atProtocol's config parameter "maxBufferSize".
Public
Store and share public data which can be seen by anyone.
Self
Store data which can only be seen by the owner.
Shared
Store and share private data which can only be seen by the owner and intended recipient.
Private
Store data which can only be seen by the owner, hidden by default.
Cached
Cache shared data from other atSigns for performance and offline mode.
Meta Attribute
Auto create?
Description
availableFrom
Yes
A Date and Time derived from the ttb (now + ttb). A Key should be only available after availableFrom.
ccd
No
Indicates if a cached key needs to be deleted when the atSign user who has originally shared it deletes it.
createdBy
Yes
atSign that has created the key
createdOn
Yes
Date and time when the key has been created.
expiresOn
Yes
A Date and Time derived from the ttl (now + ttl). A Key should be auto deleted once it expires.
isBinary
No
True if the value is a binary value.
isCached
No
True if the key is cached.
isEncrypted
No
True if the value is encrypted.
refreshAt
No
A Date and Time derived from the ttr. The time at which the key gets refreshed.
sharedWith
No
atSign of the user with whom the key has been shared. Can be null if not shared with anyone.
updatedOn
Yes
Date and time when the key has been last updated.
ttb
No
Time to birth in milliseconds.
ttl
No
Time to live in milliseconds.
ttr
No
Time in milliseconds after which the cached key needs to be refreshed. A ttr of -1 indicates that the key can be cached forever. ttr of 0 indicates do not refresh. ttr of > 0 will refresh the key. ttr of null indicates the key is impossible to cache, hence, refreshing does not make sense (which has the same effect as a ttr of 0).