[erlang-questions] How to use Mnesia Database from C/C++/Java ?

Scott Lystig Fritchie <>
Tue Jan 22 00:19:23 CET 2008


Søren Hilmer <> wrote:

sh> There is/used to be, something called Mnesia Session for doing
sh> exactly this.

I think it's been deprecated.

The bad news Amritpal will have to implement an interface from scrach.
The good news is that it isn't difficult, and there are plenty of
protocols to choose from.  Mnesia Session used CORBA, which I wouldn't
recommend.  You could do also the same structured-data things as the old
Mnesia Session CORBA via the Sun RPC library that's in Jungerl.

Using a simple/RESTful GET/POST/DELETE interface using HTTP is quite
simple.  Using SOAP wouldn't be much harder, though why you'd want to
get XML involved is an excellent question.  Also, I've seen least one
"memcached" server implementation in Erlang (I forget the author's name
but not the language: Japanese).

Even easier would be to have your C code use the Erlang term format (see
http://www.erlang.org/doc/apps/erl_interface/part_erl_interface_frame.html).
At my current employer, the whole Erlang "thing" was new enough that the
client team didn't want to use an Erlang-specific wire format, in the
event the Erlang experiment failed.  So we rolled our own little text,
TCP-based protocol.  {shrug}  

I don't know if this list posting contains anything new, but if it's
helpful, great.  http://www.nabble.com/Mnesia-td10106072.html

-Scott



More information about the erlang-questions mailing list