Is a process necessary in front of mnesia?

Woody Peterson woody.peterson@REDACTED
Thu Oct 14 19:40:30 CEST 2010


Hi All,

In the pragmatic screencasts' Erlang series, there is a gen_server in  
charge of writing to mnesia. In refactoring a small erlang system my  
company's building, we still have that boilerplate handling mnesia,  
but thought we should remove the gen_server entirely, as we could just  
use a function instead of a process as per erlang's best practices (http://www.erlang.se/doc/programming_rules.shtml#HDR16 
). Note that this gen_server holds no state, which is probably not a  
rule for when to not use a process, but seems like it could be a  
smell. I figure the gen_server in the screencasts could have just been  
there as a learning tool, so is there a reason beyond education to put  
a serializing process in front of mnesia as a rule? Are we right to  
assume we can have possibly tens of thousands of processes sending  
write messages to mnesia directly as opposed to a gen_server in front  
of it?

Thanks,

-Woody


More information about the erlang-questions mailing list