mnesia

Erlang : Mnesia : Is it safe to remove files with prefix _fs?

I have a couple of files in mnesia directory, like fs_my@node_14585_1263_545605_962084.273 fs_my@node_14702_1263_545842_879762.273 fs_my@node_14585_1263_545605_962084.290 ... Can I remove them (because it is big files) without risk to lose data? Why does these files apear? What are these files for? Is it safe to remove them? ...

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 === Setting up: "http://sub48.localhost:9000" as pirate Mnesia('[email protected]'): Data may be...

Mnesia: reading remote node data in {local_content, true} mode

Is there a way to do local writes and and global reads ( without replication ) using mnesia. Eg: node A writes to its local DB and node B reads from node A's DB. Node B does not have any data of its own, apart from the schema information stored locally. According to the documentation, {local_content, true} seems like what I need to us...

write a Query List Comprehensions for a mnesia query

I'm trying to build a small testing app with erlang+mnesia. I have a user table build from the #user record, as defined here: -record(user_details, {name, password}). -record(user, {id, details}). then I insert a user with that function: add_sample_data() -> Mat = #user{ details = #user_details{ name = "mat", password ...

How measure Web App performance ?

I have developed 3 simple blogging system in PHP/Apache/Mysql, Python/Ngix/Postgresql and in Erlang/Yaws/Mnesia. How can I measure performance on my server for this 3 different configuration ? ...

Erlang: Mnesia or Mysql ?

What DMBS do you use with Erlang ? and Why ? ...

Where are tables in Mnesia located?

I try to compare Mnesia with more traditional databases. As I understand it tables in Mnesia can be located to (see Memory consumption in Mnesia): ram_copies - tables are stored in ets, so no durability as in ACID. disc_copies - tables are located to ets and dets, so the table can not be bigger than the available memory? And if the ta...

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, V2, V3 ... or Vn (a list of arbitrary length) as the value for field f1. In SQL I would do...

How to implement dynamic queries for MNesia?

I'm trying to implement a function that generates dynamic queries for MNesia. For example, when function is called with these arguments; dyn_query(list, person, [name, age], ["jack", 21]) I want to query MNesia to list items whose name is "jack" and age is 21 in person table. I've tried to implement this by using qlc:q(ListComprehe...

Querying mnesia Fragmentated Tables using QLC returns wrong results

Hey guys, am josh in Uganda. i created a mnesia fragmented table (64 fragments), and managed to populate it upto 9948723 records. Each fragment was a disc_copies type, with two replicas. Now, using qlc (query list comprehension), was too slow in searching for a record, and was returning inaccurate results. I found out that this overhead...

mnesia primary key

Hi I have two tables one notes and one tag and I want to make the id from notes primary key to use it in the tag table, but I don't know where I do wrong. My notes id is generate from another table counter, with the function dirty_update_counter. My function for the id_notes from tag looks like this: Fun = fun() -> ...

Accessing a Mnesia node from another Erlang shell while it is running

What is the best practice to accessing a single running mnesia node from another Erlang shell to only view data in the tables? I tried opening two shells and pointing them to the same mnesia directory location which I realized was a very bad idea after finding this in the documentation. -mnesia dir Directory. The name of the directory...

How to handle mnesia schemas the standard way?

Suppose i have an application A which depends on mnesia with disk-enabled schema being present. What i'd like to do is ensure that mnesia is running and allowing disc_copiestables from within A. I'm also considering the case where multiple applications need to access mnesia. What would be the most portable (and standard) way to achie...

Erlang - Standard location of mnesia database

Hi, Is there a standard place to put the mnesia database within erlang? At the moment I am putting it in the priv directory. ...

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? ...

Stopping of Erlang app hangs when mnesia stopped from within the program

Hi all, I've run into a problem where I cannot stop mnesia within my program without causing the app to hang. I'm presently doing prototyping of mnesia within my erlang app. In my jaus_app.erl file the start() calls: {atomic, ok} = mnesia:load_textfile("priv/mnesia_prototype.txt") My stop() function calls: mnesia:dump_to_textfile(...

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

Iam running two erlang nodes with a replicated mnesia database. Whenever i tried to start one of them while mnesia ISNOT Running on the other one, mnesia:wait_for_tables(?TABS,?TIMEOUT), would hang on the node thats its called from. I need to have a structure where (if both nodes are not running), i can start working with one while the o...

erlang mnesia - illegal record info

I am trying to have a function that ensures the table I need is already created and if not to create it. Here's the sample: ensure_table_exists(Table, MnesiaTables, Nodes) -> case lists:member(Table, MnesiaTables) of true -> throw({error, db_might_have_already_been_created}); false -> mnesia:create_table(Table, [...

remove not_exist_already node from mnesia cluster(scheme)

i have bad node (it is already not exists) in mnesia cluster data when i get > mnesia:system_info(db_nodes) [bad@node, ...] how to remove it from cluster? i do > mnesia:del_table_copy(scheme, bad@node). {aborted,{not_active,"All replicas on diskfull nodes are not active yet"... what is mean? what can i do to fix it? ...

how to backup/restore only single table from/to mnesia?

I have some big tables with disc_only_copies type. Now I need change short node name to long but cannot do it with RAM limitation... Can I use backup/restore database partly (table by table)? ...