Skip to content

Options: Internal Databases

Internal databases are used to cluster MongooseIM nodes, and to replicate in-memory data (e.g. client sessions) between them.

Mnesia is a legacy way to cluster MongooseIM nodes. It is also could be used to store persistent data, but we recommend to use RDBMS databases instead because of scalability and stability reasons.

CETS is a new way to cluster MongooseIM nodes. CETS needs to know a list of nodes for the node discovery. There are two ways to get a list of nodes:

  • RDBMS database. MongooseIM would write into RDBMS its nodename and read a list of other nodes. This is the best option if you are already using a relational database.
  • A text file with a list of nodes on each line. It is useful when there is an external script to make this file based on some custom logic (for example, a bash script that uses AWS CLI to discover instances in the autoscaling group). This file would be automatically reread on change.

Omitting this section entirely is equivalent to having only Mnesia enabled:


The following example enables only CETS with the default RDBMS discovery backend:



When switching to CETS, you need to configure particular backends to actually use it:

Sometimes you might want to have both databases enabled and choose which backends use a particular DB:



CETS Options


Backend for CETS discovery.

  • Syntax: string, one of "rdbms", "file".
  • Default: "rdbms"
  • Example: backend = "rdbms"


Namespace for the cluster. Only nodes with the same cluster name would be discovered. This option is for RDBMS backend.

  • Syntax: string.
  • Default: "mongooseim"
  • Example: cluster_name = "mongooseim"


File to read a list of nodes from. Relative to the MongooseIM's release directory. This option is for the file backend. Required, if backend = "file".

  • Syntax: path.
  • Default: not specified.
  • Example: node_list_file = "/etc/mim_nodes.txt"


The following example enables CETS with the file discovery backend:

    backend = "file"
    node_list_file = "cets_disco.txt"