users
stores user accounts
Fields:
Id
user id, primary keyCreatedAt
timestamp when the user was createdUpdatedAt
timestamp when user metadata was updatedDeletedAt
currently unusedAccess
user's default access level for peer to peer topicsAuth
,Anon
permissions for authenticated and anonymousUsername
username part of "basic" authenticationPasshash
bcrypt password part of "basic" authenticationPublic
application-defined dataState
currently unused
Indexes:
Id
primary keyUsername
index
Sample:
{
"Access": {
"Anon": 0 ,
"Auth": 7
} ,
"CreatedAt": Wed Oct 14 2015 08:06:50 GMT+00:00 ,
"DeletedAt": null ,
"Id": "_hyPZc_c0CA" ,
"Passhash": <binary, 60 bytes, "24 32 61 24 31 30..."> ,
"Public": "Bob Smith" ,
"State": 1 ,
"UpdatedAt": Wed Oct 14 2015 08:06:50 GMT+00:00 ,
"Username": "bob"
}
The table stores topics.
Fields:
Id
unusedCreatedAt
topic creation timeUpdatedAt
timestamp of the last change to topic metadataDeletedAt
currently unusedAccess
stores topic's default access permissionsAuth
,Anon
permissions for authenticated and anonymous users respectivelyLastMessageAt
timestamp of the last message sent through the topicName
topic namePublic
application-defined dataState
currently unusedUseBt
currently unused
Indexes:
Id
primary keyName
index
Sample:
{
"Access": {
"Anon": 64 ,
"Auth": 64
} ,
"CreatedAt": Thu Oct 15 2015 04:06:51 GMT+00:00 ,
"DeletedAt": null ,
"Id": "9lKtRlK22z8" ,
"LastMessageAt": Sat Oct 17 2015 13:51:56 GMT+00:00 ,
"Name": "p2pPf5tU9aEakY_KhNzrN7avA" ,
"Public": null ,
"State": 0 ,
"UpdatedAt": Thu Oct 15 2015 04:06:51 GMT+00:00 ,
"UseBt": false
}
The table stores relashinships between users and topics.
Fields:
Id
used for object retrievalCreatedAt
timestamp when the user was createdUpdatedAt
timestamp when user metadata was updatedDeletedAt
currently unusedClearedAt
user soft-deleted messages older than this timestampTopic
name of the topic subscribed toUser
subscriber's user IDLastMessageAt
timestamp of the last message sent through the topic which given user was able to receiveLastSeen
when the user last accessed the topic from the given clienttag
client IDwhen
timestamp of the last accessModeWant
access mode that user wants when accessing the topicModeGiven
access mode granted to user by the topicPrivate
application-defined data, accessible by the user only
Indexes:
Id
primary key composed as "topic name ':' user ID"User_UpdatedAt
compound index["User", "UpdatedAt"]
Topic_UpdatedAt
compound index["Topic", "UpdatedAt"]
Sample:
{
"ClearedAt": null ,
"CreatedAt": Thu Oct 15 2015 10:24:51 GMT+00:00 ,
"DeletedAt": null ,
"Id": "grp27bT-X_W8__6:px8jR3_EtDk" ,
"LastMessageAt": null ,
"LastSeen": null , // NEEDS BETTER SAMPLE
"ModeGiven": 7 ,
"ModeWant": 7 ,
"Private": "Kirgudu" ,
"Topic": "grp27bT-X_W8__6" ,
"UpdatedAt": Thu Oct 15 2015 10:24:51 GMT+00:00 ,
"User": "px8jR3_EtDk"
}
The table stores {data}
messages
Fields:
Id
currently unusedCreatedAt
timestamp when the message was createdUpdatedAt
unused, created for consistencyDeletedAt
currently unusedFrom
ID of the user who generated this messageTopic
which routed this messageContent
application-defined message payload
Indexes:
Id
primary keyTopic_CreatedAt
compound index["Topic", "CreatedAt"]
Sample:
{
"Content": "Cogito cogito ergo cogito sum." ,
"CreatedAt": Mon Oct 19 2015 12:20:01 GMT+00:00 ,
"DeletedAt": null ,
"From": "BVbQIzu7hag" ,
"Id": "Zn1rC3UuhjE" ,
"Topic": "grpJ-l4wO0Fwvy3" ,
"UpdatedAt": Mon Oct 19 2015 12:20:01 GMT+00:00
}
The table is used to ensure uniqueness of user names because RethinkDB does not support unique secondary indexes natively. The unique values are stored as primary key entries in the form "table name '!' field name '!' value"
id
primary key
Sample:
{
"id": "users!username!bob"
}