Mnesia

Mnesia
Mnesia
Stable release 4.5 / October 6, 2011; 45 days ago (2011-10-06)
Written in Erlang
Operating system Cross-platform
Platform Cross-platform
Type Relational Database Management System
License Open Source Erlang Licence
Website erlang.org/doc/apps/mnesia

Mnesia is a distributed, soft real-time database management system written in the Erlang programming language[1].

Contents

Purpose of Mnesia

As with Erlang, Mnesia was developed by Ericsson for soft real-time distributed and high-availability computing work related to telecoms. It was not intended as a general office-based data processing DBMS, nor to replace SQL-based systems. Instead Mnesia exists to support Erlang, where DBMS-like persistence is required[2]. It has more in common with embeddable DBMS such as Berkeley DB than with a SQL database server.

Working with Mnesia

Database model

"Rows" in tables are represented as records that contain a key value and a data field. This data field may in turn be a tuple containing an Erlang data structure of any complexity.

Relational features

The database model is relational, but isn't what someone familiar with SQL might expect. A database contains tables. Relationships between them are modelled as other tables[3].

A key feature of Mnesia's high-availability approach is that tables can be reconfigured within a schema and relocated between nodes, not only while the database is still running, but even while write operations are still going on.

Coding for Mnesia

The query language of Mnesia is Erlang itself, rather than SQL[4]. It permits easy representation of transactions as a natural feature of Erlang by allowing developers to utilize a single language throughout an application.

Transactions

Erlang is a functional language. Mnesia builds on this to obtain ACID transaction support. The functional block which is run as a transaction is a commonplace Erlang construct called a Functional Object (or Fun)[5] and is called by the single Mnesia statement mnesia:transaction(F). This can lead to clearer source code than the paired BEGIN / COMMIT syntax of SQL, and so avoids its problem of unclosed transactions within a procedure.

Again as a result of the functional nature of Erlang, nesting transactions is simple. It's also possible to distribute transactions across multiple nodes (i.e. separate servers). The semantics of using transactions in this way remains consistent, making it easy to write library code that works equally in either context.

General coding style for Mnesia will always use transactions. For performance reasons, it also supports deliberate "dirty operations" which avoid transactions. These compromise the atomicity and the isolation properties of ACID, but offer around 10× more throughput[6]. In addition there are also in-memory alternatives, although these lose the durability property of ACID.

Efficient execution

Mnesia forms part of the LYME web application stack. This is akin to LAMP, but based on Erlang. An efficiency benefit that implementation in Erlang confers is the use of a single VM throughout an application. LYME makes use of this, the Yaws web server also being implemented in Erlang.

Another low-level boost to efficiency is that address space is shared (although safely so, under Erlang) between code and data, including Mnesia's table data[1][7].

Origins and licensing

Mnesia (and Erlang) were developed by the Ericsson Computer Science Laboratory. They have been open-sourced "to help encourage the spread of Erlang outside Ericsson."[8] They are published according to the open source Erlang Public License[9].

Contemporary interest in Mnesia

ejabberd

Mnesia is also an option embedded within the Erlang-based Jabber daemon, ejabberd[10].

See also

References


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Mnesia — Тип Документо ориентированная СУБД Написана на Erlang Операционная система Cross platform Аппаратная платформа Cross platform Последняя версия 4.7[1] ( …   Википедия

  • -mnesia — ► sufijo Componente de palabra procedente del gr. mneme, que significa memoria: ■ amnesia. * * * ► Sufijo procedente del gr. mnēmē, memoria …   Enciclopedia Universal

  • -mnesia — mne·sì·a conf. TS neurol., psic. memoria, relativo alla memoria, spec. con riferimento a disturbi o alterazioni: ecmnesia {{line}} {{/line}} ETIMO: tratto da amnesia …   Dizionario italiano

  • -mnesia — mne·sia …   English syllables

  • -mnesia — (m)ˈnēzh(ē)ə noun combining form ( s) Etymology: New Latin, from amnesia : a (specified) type or condition of memory cryptomnesia …   Useful english dictionary

  • Erlang (programming language) — Erlang Paradigm(s) multi paradigm: concurrent, functional Appeared in 1986 Designed by Ericsson …   Wikipedia

  • Oracle (СУБД) — У этого термина существуют и другие значения, см. Oracle. Oracle Database Тип Объектно реляционн …   Википедия

  • Db4o — (db4objects) встраиваемая (embedded) система управления базами данных для объектов с открытым исходным кодом. Для некоммерческого использования db4o доступна под лицензией GPL. Поскольку СУБД предназначена для хранения объектов, её полноценная… …   Википедия

  • IBM DB2 — DB2 Тип Система управления базами данных Разработчик IBM Написана на C, C++ ОС Кроссплатформенное ПО …   Википедия

  • Иерархические базы данных — Иерархическая модель базы данных состоит из объектов с указателями от родительских объектов к потомкам, соединяя вместе связанную информацию. Иерархические базы данных могут быть представлены как дерево, состоящее из объектов различных уровней.… …   Википедия

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”