Questions tagged [mnesia]

A distributed DataBase Management System used in Erlang applications.

Mnesia is a distributed DataBase Management System (DBMS), appropriate for telecommunications applications and other Erlang applications which require continuous operation and exhibit soft real-time properties.

414 questions
4
votes
1 answer

Monitoring and Prevention Of Systems Limit Crashes For Mnesia In An Erlang System

We have a number of cloud servers and I am building a new one to test provision of resources on. I am getting a fatal crash way before I think I ought to, as some sort of system resource is running out. =INFO REPORT==== 14-Feb-2010::12:40:14…
Gordon Guthrie
  • 6,252
  • 2
  • 27
  • 52
4
votes
2 answers

Erlang Mnesia - mnesia:transaction(F) vs. mnesia:activity(transaction, F)

I've read and re-read the docs re: mnesia:activity/3, mnesia:activity/4, and mnesia/transaction/2, but they still read like an obscure foreign language to me. In my limited experiments they seem to return the same result. Can some kind soul help me…
Lloyd R. Prentice
  • 4,329
  • 3
  • 21
  • 31
4
votes
2 answers

ejabberd : replace mnesia with mysql

Is there any way to setup mysql in place of mnesia. any help on this is much appreciated. Everything for me went on fine. Also I need to archive the history text. Thanks in advance Abraham
4
votes
1 answer

Mnesia: time and space efficiency of read, match_object, select, and qlc queries

Mnesia has four methods of reading from database: read, match_object, select, qlc. Besides their dirty counterparts of course. Each of them is more expressive than previous ones. Which of them use indices? Given the query in one of this methods…
citxx
  • 2,525
  • 17
  • 40
4
votes
1 answer

Drop pending Mnesia transactions

I have a Mnesia database and when I restart my application, I get an error (badarg) in the pending transactions. I think an invalid value was about to be inserted. How can I inspect the pending transactions to look up what the bad value is and how…
4
votes
1 answer

Mnesia: how to use indexed operations correctly when selecting rows based on criteria involving multiple, indexed columns

Problem: How to select records efficiently from a table where the select is based on criteria involving two indexed columns. Example I have a record, #rec{key, value, type, last_update, other_stuff} I have indexes on key (default), type and…
Jr0
  • 2,131
  • 13
  • 23
4
votes
1 answer

Official/Advised/Allowable maximum number of records (or RAM Table Size) in ETS / Mnesia RAM Table

Erlang has been a good application to many "New Age" (obscenely fast and fault tolerant ) Messaging Systems. Examples can be RabbitMQ, ejabberd, WhatsApp for Mobile e.t.c. Regardless of how a messaging system is built, it will need to know what…
Muzaaya Joshua
  • 7,736
  • 3
  • 47
  • 86
4
votes
3 answers

Mnesia write fails

I defined a record named log. I want to create an mnesia table with name log_table. When I try to write a record to table, I get bad_type error as follows: (node1@kitt)4> mnesia:create_table(log_table, [{ram_copies, [node()]}, …
Haldun
  • 1,255
  • 1
  • 14
  • 18
4
votes
2 answers

Find max/min value of column in Mnesia in constant time

How can I in constant time (or closest possible) find the maximum or minimum value on an indexed column in an Mnesia table?
Magnus Kronqvist
  • 1,559
  • 12
  • 22
4
votes
2 answers

How to define a foreign key in Mnesia

Is there an equivalent to this SQL statement in Mnesia? alter table TABLE add foreign key (FIELD) references TABLE2 (FIELD2)
Jonny Heggheim
  • 1,423
  • 1
  • 12
  • 19
4
votes
2 answers

erlang - how can I match tuple contents with qlc and mnesia?

I have a mnesia table for this record. -record(peer, { peer_key, %% key is the tuple {FileId, PeerId} last_seen, last_event, uploaded = 0, downloaded = 0, left = 0, ip_port, key }). Peer_key is a tuple {FileId,…
Matteo Caprari
  • 2,869
  • 4
  • 27
  • 35
4
votes
3 answers

Unique constraint in Mnesia

I am developing an Erlang application which requires a LOT of DB writes. My schema has, in addition to the primary key, another attribute with a unique constraint enforced. Say I have an ID, an unique_constraint_field, and some other fields. I need…
jeffreyveon
  • 13,400
  • 18
  • 79
  • 129
3
votes
2 answers

Differences between set and ordered_set in Mnesia?

What are the differences between a table of type set, and a table of type ordered_set? I'm interested in the differences in read/write performance, what the ordering is based on, the effects across distributed nodes, and such.
soundly_typed
  • 39,257
  • 5
  • 28
  • 36
3
votes
1 answer

Mnesia equivalent of SQL NOT IN

I have two records: -record(foo, {timestamp, name}). -record(bar, {timestamp, name}). And I would like to execute a Mnesia query that mimics the following SQL query SELECT f.* FROM foo f WHERE f.timestamp NOT IN ( SELECT b.timestamp FROM boo…
Ward Bekker
  • 6,316
  • 9
  • 38
  • 61
3
votes
1 answer

How are 'conventional wisdom' concepts implemented in Mnesia? Referential integrity, replication, high capacity

I want to learn a functional language and Mnesia seems "killer app" enough for me to learn Erlang. I want some concepts clarified first. How does Mnesia enforce referential integrity on relations? Old articles say that it is not enforced at the data…
Jesvin Jose
  • 22,498
  • 32
  • 109
  • 202