[erlang-questions] Programmatically replicating Mnesia to DB2
Thu Apr 18 20:08:43 CEST 2013
Le 18 avr. 2013 à 13:26, a écrit :
> My erlang application makes thousands of entries into an Mnesia table. I would like the same records to be also inserted into an equivalent table in a DB2 database without blocking the call that inserts into Mnesia. Is there a hook that Mnesia provides where all insertions can be trapped and where I can put my code that inserts the same record into DB2?
You could have a process subscribed to mnesia table events (see mnesia:subscribe and mnesia user guide). It would receive a message for each write and could duplicate the write to DB2.
More information about the erlang-questions