---
name: "mnesia_registry"
section: "3erl"
platform: "linux"
package: "erlang-manpages"
version: "1:25.2.3+dfsg-1+deb12u4"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/mnesia_registry"
---

# mnesia\_registry(3erl)

Dump support for registries in erl\_interface.

## NAME

mnesia\_registry - Dump support for registries in erl\_interface.

## DESCRIPTION

This module is usually part of the *erl\_interface* application, but is currently part of the Mnesia application.

This module is mainly intended for internal use within OTP, but it has two functions that are exported for public use.

On C-nodes, *erl\_interface* has support for registry tables. These tables reside in RAM on the C-node, but can also be dumped into Mnesia tables. By default, the dumping of registry tables through *erl\_interface* causes a corresponding Mnesia table to be created with *mnesia\_registry:create\_table/1*, if necessary.

Tables that are created with these functions can be administered as all other Mnesia tables. They can be included in backups, replicas can be added, and so on. The tables are normal Mnesia tables owned by the user of the corresponding *erl\_interface* registries.

## EXPORTS

**create\_table(Tab) -\> ok \| exit(Reason)**\

A wrapper function for *mnesia:create\_table/2*, which creates a table (if there is no existing table) with an appropriate set of *attributes*. The table only resides on the local node and its storage type is the same as the *schema* table on the local node, that is, *{ram\_copies,\[node()\]}* or *{disc\_copies,\[node()\]}*.

This function is used by *erl\_interface* to create the Mnesia table if it does not already exist.

**create\_table(Tab, TabDef) -\> ok \| exit(Reason)**\

A wrapper function for *mnesia:create\_table/2*, which creates a table (if there is no existing table) with an appropriate set of *attributes*. The attributes and *TabDef* are forwarded to *mnesia:create\_table/2*. For example, if the table is to reside as *disc\_only\_copies* on all nodes, a call looks as follows:

```
          TabDef = [{{disc_only_copies, node()|nodes()]}],
          mnesia_registry:create_table(my_reg, TabDef)
```

## SEE ALSO

erl\_interface(3erl), [mnesia(3erl)](/mnesia/3erl.md)
