volunteer wanted to write a few FAQ entries about Mnesia

Ulf Wiger <>
Fri Feb 21 11:53:02 CET 2003


On Thu, 20 Feb 2003, Chris Pressey wrote:

>Records are accessed by a single key (which may be unique
>or duplicate) and there is no concept of a secondary key.

Actually there is. You can define an index on a non-key
attribute, and access records using mnesia:index_read/3 or
index_match_object/2.

There is also support for adding SNMP attributes to a table,
where multiple non-key attributes can be combined to form an
SNMP key. This way, you can perform get, and get_next
operations directly on a mnesia table. The obvious use for
this is when creating an SNMP MIB, where you can pass a
{db,mnesia} option to the MIB compiler and have it do most
of the work for you. An example of this can be found
in the SNMP User's Guide:

http://www.erlang.org/doc/r9b/lib/snmp-3.3.8/doc/html/snmp_advanced.html#7.6


>Mnesia itself can't intercept a request to update or delete
>a record, but the RDBMS module can do that for it.

Or, put another way, you can customize the access pattern of
mnesia using a callback module. This is what RDBMS does.

/Uffe
-- 
Ulf Wiger, Senior Specialist,
   / / /   Architecture & Design of Carrier-Class Software
  / / /    Strategic Product & System Management
 / / /     Ericsson AB, Connectivity and Control Nodes




More information about the erlang-questions mailing list