Data storage

Prosody needs to store a certain amount of data, primarily about users. For example account names/passwords, contact lists, profiles. The storage system is extensible via plugins. We have two plugins that come with Prosody, “internal” and “sql”.

Selecting a storage backend

Select the storage backend to load with the ‘storage’ configuration option. It is not necessary to add storage plugins to modules_enabled - they are loaded automatically on-demand.

Example to use the “internal” storage backend for all stores:

storage = "internal"

Example to store rosters using “sql”, and everything else using the default “internal” backend:

storage = {
    roster = "sql";
}

Example to store everything using “sql”, except accounts:

default_storage = "sql"
storage = {
    accounts = "internal";
}

Backends

Name Description Archive support
internal Default file-based storage. Yes
sql SQL database support. Yes
memory Keeps data in memory only, intended for tests, not for production Yes
null Built-in backend that always fails to load/save data. No
none Backend where all stores are always empty and saving data always fails. No

Additional storage backends are available in from the Community modules project.

Common stores

These are the stores used by core modules. Usually stores will have the same name as the module using it. Community modules may use additional stores.

Store Description Modules
accounts Account details, such as (hashed) password mod_auth_internal_plain, mod_auth_internal_hashed
account_details Extra account details mod_register
account_flags Flagged accounts mod_flags
account_roles Dynamically assigned roles mod_authz_internal
accounts_cleanup Tracking accounts scheduled for deletion mod_user_account_management
auth_tokens Access tokens mod_tokenauth
invite_token Invite tokens mod_invites
roster User contact lists mod_roster, rostermanager
vcard Profile details and avatar mod_vcard
vcard_muc MUC room avatars mod_vcard
private Private XML storage data mod_private
blocklist Blocked JIDs mod_blocklist
privacy Privacy lists mod_privacy
archive Message archives mod_mam
archive_cleanup Message retention tracking mod_mam
archive_prefs Message archiving preferences mod_mam
muc_log MUC message archives mod_muc_mam
muc_log_cleanup Message retention tracking mod_muc_mam
persistent Set of persistent MUC rooms mod_muc
config Room configuration mod_muc
state Room state (e.g. during restarts) mod_muc
cloud_notify Device notification registrations mod_cloud_notify
cron Record keeping for recurring jobs mod_cron
offline Offline messages mod_offline
pubsub_nodes PubSub node configuration mod_pubsub
pubsub_data PubSub node data (archive type) mod_pubsub
pep PEP node configuration mod_pep
pep_data PEP node data (archive type) mod_pep
skeletons Account lookalike tracking data mod_mimicking
smacks_h Stanza counters mod_smacks
tombstones Tombstones for deleted accounts mod_tombstones
upload_stats Statistics about uploaded files mod_http_file_share
uploads Records of uploaded files mod_http_file_share

Migrating data between stores

Prosody includes a migration tool.