Skip to content

Conversation

badlop
Copy link
Member

@badlop badlop commented Sep 17, 2025

When ejabberd first got support for SQL storage, it only supported one vhost, so it made sense to not store the host in the SQL tables. Additionally, the SQL schema in ejabberd followed that of jabberd14, which didn't support vhost either.

When ejabberd got support for multiple vhosts, if several of them want to use SQL storage, the solution is to configure a different SQL database for each vhost using the host_config toplevel option.

However, when there are many vhosts configured in ejabberd, all of them using SQL storage, it is preferable to setup one single SQL database, and store the vhost in the tables. When that feature was added to ejabberd, it got the name of "new SQL schema". And the previous SQL schema was called "legacy", "old", and nowadays "default".

The problem with the terms "default" and "new" is that they are circumstantial, and do not really describe the schema features or purposes.

I propose to rename:

  • "default SQL schema" --> "singlehost SQL schema"
  • "new SQL schema" --> "multihost SQL schema"

Right now all names are supported, the previous (obsolete) and the renamed (preferred). The changes relevant to the usage are:

When preparing configuration, the arguments:

  ./configure --enable-new-sql-schema
  ./configure --enable-multihost-sql-schema

When configuring ejabberd, the toplevel options:

  new_sql_schema: true
  sql_schema_multihost: true

When developing source code, the functions:

  ejabberd_sql:use_new_schema()
  ejabberd_sql:use_multihost_schema()

Right now all names are supported, the previous (obsolete)
and the renamed (preferred). The changes relevant to the usage are:

When preparing configuration, the arguments:
  ./configure --enable-new-sql-schema
  ./configure --enable-multihost-sql-schema

When configuring ejabberd, the toplevel options:
  new_sql_schema: true
  sql_schema_multihost: true

When developing source code, the functions:
  ejabberd_sql:use_new_schema()
  ejabberd_sql:use_multihost_schema()
@coveralls
Copy link

Coverage Status

coverage: 33.815%. remained the same
when pulling 5575d4e on badlop:multihost
into 4dea2f1 on processone:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants