Schema Description

This description contains only basic description of schema and only basic part of it. More collections may be created if additional components of Tigase XMPP Server are loaded and configured to use MongoDB.

Tigase XMPP Server Schema

Basic schema for UserRespository and AuthRepository consists of two collections: . tig_users - contains list of users . tig_nodes - contains data related to users in tree-like way

tig_users collection contains the following fields:

Table 7. tig_users

Name Description


id of user which is SHA256 hash of users jid (raw byte array).


contains full user jid.


domain to which user belongs for easier lookup of users by domain.


password of user (will be removed after upgrade to 8.0.0).

tig_nodes collection contains the following fields

Table 8. tig_nodes

Name Description


id of row auto-generated by MongoDB.


id of user which is SHA256 hash of users jid (raw byte array).


full path of node in tree-like structure separated by / (may not exist).


key for which value for node is set.


value which is set for node key.

Tigase XMPP Server also uses additional collections for storage of Offline Messages

Table 9. msg_history collection

Name Description


full user jid of message sender.


SHA256 hash of message sender jid as raw byte array.


full users jid of message recipient.


SHA256 hash of message recipient full jid as raw byte array.


timestamp of message as date.


serialized XML stanza containing message.


timestamp of expiration of message (if message contains AMP expire-at set).

<mongodb-schema-changes-8> <title>Additions for v8.0 Schema</title>

Due to changes in authentication and credentials storage in AuthRepository, we moved password field from tig_users collection to a newly created collection called tig_user_credentials.

This new collection has following fields:

Name Description


id of document automatically generated by MongoDB


SHA256 hash of a user for which credentails are stored


username provided during authentication (or default)


name of an account state (copy of value stored in user document from`tig_users`)

Additionally for each mechanism we store separate field in this object, so for:

  • PLAIN we have PLAIN field with value for this mechanism
  • SCRAM-SHA-1 we have SCRAM-SHA-1 field with value for this mechanism
  • etc…​

Upgrade is not done in one step, and rather will be done once a particular user will log in. During authentication if there is no data in tig_user_credentials, Tigase XMPP Server will check if password field in tig_user exists. If it does, and it is filled credentials will be migrated to the new collection.