Skip to content

RDBMS

Overview

This authentication method stores user accounts in a relational database, e.g. MySQL or PostgreSQL.

Configuration

The rdbms method uses an outgoing connection pool of type rdbms with the default tag - it has to be defined in the outgoing_pools section.

auth.rdbms.users_number_estimate

  • Scope: local
  • Syntax: boolean
  • Default: false
  • Example: users_number_estimate = true

By default querying MongooseIM for the number of registered users uses the SELECT COUNT query, which might be slow. Enabling this option makes MongooseIM use an alternative query that might be not as accurate, but is always fast.

Note: this option is effective only for MySQL and PostgreSQL.

Example

Authentication:

1
2
3
4
5
[auth]
  methods = ["rdbms"]

  [auth.rdbms]
    users_number_estimate = true

Outgoing pools:

1
2
3
4
5
6
[outgoing_pools.rdbms.default.connection]
  driver = "pgsql"
  host = "localhost"
  database = "mongooseim"
  username = "mongooseim"
  password = "mongooseim_secret"