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
roster User contact lists mod_roster, rostermanager
vcard Profile details and avatar mod_vcard
private Private XML storage data mod_private
blocklist Blocked JIDs mod_blocklist
privacy Privacy lists mod_privacy
archive Message archives mod_mam
muc_log MUC message archives mod_muc_mam
persistent Set of persistent MUC rooms mod_muc
config Room configuration mod_muc
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

Migrating data between stores

Prosody includes a migration tool.