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
10
votes
4 answers

Best way to print out Mnesia table

I tried this code snippet: print_next(Current) -> case mnesia:dirty_next(muppet, Current) of '$end_of_table' -> io:format("~n", []), ok; Next -> [Muppet] = mnesia:dirty_read({muppet, Next}), …
Yola
  • 18,496
  • 11
  • 65
  • 106
10
votes
2 answers

Preserving relational integrity with Mnesia

I've been diving into Erlang recently, and I decided to use Mnesia to do my database work given it can store any kind of Erlang data structure without a problem, scale with ease, be used with list comprehensions, etc. Coming from standard SQL…
I GIVE TERRIBLE ADVICE
  • 9,578
  • 2
  • 32
  • 40
10
votes
1 answer

What is the significance of a Mnesia Master Node in a cluster

I am running two erlang nodes with a replicated mnesia database. Whenever I tried to start one of them while mnesia IS NOT Running on the other one, mnesia:wait_for_tables(?TABS,?TIMEOUT), would hang on the node that its called from. I need to have…
Muzaaya Joshua
  • 7,736
  • 3
  • 47
  • 86
9
votes
2 answers

How far should I take referential transparency?

I am building a website using erlang, mnesia, and webmachine. Most of the documentation I have read praises the virtues of having referentially transparent functions. The problem is, all database access is external state. This means that any method…
Abtin Forouzandeh
  • 5,635
  • 4
  • 25
  • 28
8
votes
0 answers

Mnesia Fragmentation and replication: resultant availability and reliability

Following the solutions to the question i asked recently about mnesia fragmentation, I still have a number of challenges. Consider the following scenario (The question I am asking is based on what follows below): You have a data driven enterprise…
Muzaaya Joshua
  • 7,736
  • 3
  • 47
  • 86
8
votes
3 answers

Using gen_server to encapsulate an mnesia table?

I have a server application made in Erlang. In it I have an mnesia table that store some information on photos. In the spirit of "everything is a process" I decided to wrap that table in a gen_server module, so that the gen_server module is the…
Erik Edin
  • 680
  • 4
  • 8
7
votes
2 answers

How to detect whether the mnesia schema and table have been created in code?

I want to create an mnesia schema and table in my code after the system starts, so I need to detect weather the mnesia schema and table have been created. If not, I want to create them. Is this a good idea? And how can I detect the mnesia schema and…
why
  • 23,923
  • 29
  • 97
  • 142
7
votes
3 answers

Mnesia: How to lock multiple rows simultaneously so that I can write/read a "consistent" set of of records

HOW I WISH I HAD PHRASED MY QUESTION TO BEGIN WITH Take a table with 26 keys, a-z and let them have integer values. Create a process, Ouch, that does two things over and over again In one transaction, write random values for a, b, and c such that…
Jr0
  • 2,131
  • 13
  • 23
7
votes
1 answer

mnesia: intensive usage table

When I receive such message, like this: ** WARNING ** Mnesia is overloaded: {dump_log, write_threshold} what is approach to known which table is being used intensively? What kind of debugging do I need to do? Thanks.
vinnitu
  • 4,234
  • 10
  • 41
  • 59
7
votes
2 answers

ejabberd: inspect Mnesia tables?

I'm digging into ejabberd but I can't find a way to inspect its Mnesia tables. Is there something like the MySQL shell to inspect tables?
Tommy
  • 1,219
  • 11
  • 18
7
votes
3 answers

Erlang Mnesia Equivalent of SQL Select FROM WHERE Field IN (value1, value2, value3, ...)

I have an mnesia table with fields say f1, f2, f3. Now if I were to select all the rows with the field value as V1, I would use mnesia:select and match specifications or a simple mnesia:match_object. Now I need to select all the rows which have V1,…
ErJab
  • 6,056
  • 10
  • 42
  • 54
7
votes
2 answers

Erlang: specifying a working directory for mnesia?

How do I specify a working directory for mnesia without resorting to passing the "dir" parameter on the command-line? In other words, can I specify a "working directory" for mnesia just before calling `mnesia:start()' ?
jldupont
  • 93,734
  • 56
  • 203
  • 318
7
votes
2 answers

Erlang : Mnesia : Updating a single field value in a row

I have an mnesia table with three fields, i, a and b, created using the record -record(rec, {i, a,b}). Now I insert a row into the table as: mnesia:transaction( fun() -> mnesia:write("T", #rec{i=1, a=2, b=3}, write) end ). Now what do I do if I…
ErJab
  • 6,056
  • 10
  • 42
  • 54
7
votes
1 answer

What's the simplest way to update mnesia schema?

For example, I saved {id, name} in mnesia and want to update to {id, name, age}, do I have to call transform_table every time I change schema?
Comet Liao
  • 295
  • 2
  • 13
6
votes
4 answers

Mnesia can't connect to another node

I am setting up a rabbitmq cluster and ran into an issue during the one step in the process. Its straight out of the rabbitmq clustering guide. root@celery:~# rabbitmqctl status Status of node celery@celery ... [{pid,20410}, …
Shakakai
  • 3,514
  • 1
  • 16
  • 18
1
2
3
27 28