[erlang-questions] Desing of MVC models

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Mon Sep 16 13:24:47 CEST 2013


On Sun, Sep 15, 2013 at 10:44 PM, Ludovic Demblans <ludovic@REDACTED>wrote:

> Hi Jesper, i don't really understand why you advise me to use a very
> fast DB, (like voltDB) because your previous point was that if things
> are kept in state, storing it to the database should only be done from
> time to time (like just after killing a big boss).
>
> I want my models transient (even implemented as regular gen_servers),
> but i don't want to brutal-kill them : I just ask them gently to
> terminate and to store their data before. So they have time to do so.
>

I am just trying to say that this model will scale quite well. Since you
will have relatively few write-backs to stable storage. Also note you will
have very few reads compared to writes in this model. So write-centric
database systems can also do well in this scheme. Cassandra comes to mind,
but I don't like it too much.

I would probably just have a timeout on the gen_servers and if they are not
being used for some grace-period, they write their state back onto stable
storage and terminates. If a player then comes back, you can rejuvenate the
process. Eventually by replaying all moves from the start. This means the
capacity of the machine is limited by number of players currently playing,
which is probably a much lower number than the amount of players in the
database systems.



-- 
J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130916/3a09f6d4/attachment.htm>


More information about the erlang-questions mailing list