From the documentation:
Mnesia is a distributed Database Management System, appropriate for telecommunications applications and other Erlang applications which require continuous operation and soft real-time properties. It is one section of the Open Telecom Platform (OTP), which is a control system platform for building telecommunications applications.
In particular the very high level of fault tolerance which is required in many nonstop systems, combined with requirements on the DBMS to run in the same address space as the application, have led us to implement a brand new DBMS. called Mnesia. Mnesia is implemented in, and very tightly connected to, the programming language Erlang and it provides the functionality that is necessary for the implementation of fault tolerant telecommunications systems. Mnesia is a multiuser Distributed DBMS specially made for industrial telecommunications applications written in the symbolic programming language Erlang, which is also the intended target language. Mnesia tries to address all of the data management issues required for typical telecommunications systems and it has a number of features that are not normally found in traditional databases.
In telecommunications applications there are different needs from the features provided by traditional DBMSs. The applications now implemented in the Erlang language need a mixture of a broad range of features, which generally are not satisfied by traditional DBMSs. Mnesia is designed with requirements like the following in mind:
Fast real-time key/value lookup
Complicated non real-time queries mainly for operation and maintenance
Distributed data due to distributed applications
High fault tolerance
Dynamic re-configuration
Complex objects
What sets Mnesia apart from most other DBMSs is that it is designed with the typical data management problems of telecommunications applications in mind. Hence Mnesia combines many concepts found in traditional databases, such as transactions and queries with concepts found in data management systems for telecommunications applications, such as very fast real-time operations, configurable degree of fault tolerance (by means of replication) and the ability to reconfigure the system without stopping or suspending it. Mnesia is also interesting due to its tight coupling to the programming language Erlang, thus almost turning Erlang into a database programming language. This has many benefits, the foremost is that the impedance mismatch between data format used by the DBMS and data format used by the programming language, which is used to manipulate the data, completely disappears.
Mnesia versus MySQL, performance:
ejabberd consumes less computational resources when using some *SQL database than when using internal Mnesia. You are probably interested in that topic when you have many concurrent users (more than 1000, for example). With few concurrent users ejabberd's CPU consumption is negligible so admins of small servers don't care to setup an external SQL server and database.
CouchDB v. Mnesia, V. MySQL and other Mnesia topics:
One insight that immediately came to mind is that while it was blatantly obvious to me how to structure the data for MySQL, it is less so for Mnesia, and for CouchDB I am still not entirely sure of the best approach yet. For now, here are a couple of the more obvious points:
A ‘record’ has a ‘numplays’ field which obviously indicates how many times it has been played. This is fine in MySQL, but if I just incorporate this field into a document for CouchDB I will get a complete duplicate revision of the document in the database every time this one number changes, which seems awfully inefficient.
The three-table layout in MySQL of records, tags, and a link table between them (see the script if that isn’t clear) is (to me at least) obviously the right solution, but there are many possible ways of doing this in both Mnesia and CouchDB and I find I don’t intuitively have the answers.
In short, it's designed for very specific purpose and seems well engineered to suit the purpose. No one database can be abstractly compared to another. Only through the use of requirements can elements of commensurability be induced.