moving msg db to erlang