Is membase a good save level for erlang gamer server?

I want to create a browser game in which players can create buildings.

Each building will have several modules (engines, offices, production lines, ...). Each module will have one or more actions, for example, creating a 2OO “element X” with ingredients Y, Z.

The game server will be configured using erlang: the OTP application as the server itself and nitrogen as the web interface. I need data persistence. I thought of the following:

When someone or something interacts with the building or the timer representing a certain production line ends, the supervisor starts gen_server (if it has not already been created), which loads the state of the building from the database, so gen_server can respond to messages like “add this module "," launches this action "," store this product in a warehouse "," die ", etc. (

But when the building does not receive messages for X seconds or minutes, it will stop (thanks to the gen_server timeout function) and drop its current state back to the database.

So, since it will be a (soft) real-time game, gen_server needs to be configured very quickly. I thought of membase as a database because it is known to have very good response times.

My question is: when the gen server is running, its states fill some memory, and this state is present in the memory processed by membase too, so the state is used twice as large as its size in memory. Is this a bad design?

Is membase a good solution for handling perseverance in my case? would using mnesia be a better choice or something else?

I am afraid of mnesia 2 Go (or 4?) Table size limitation because I do not know at the moment the average size of my gen_servers (buildings in this example, butalso players, production lines, whatever), and I can have someday more than 1 player :)

thank

+5
source share
2 answers

Hynek -Pichi- Vychodil. Riak - .

Riak 95% , . - . , Riak - , , !

Riak - . Riak : http://joyeur.com/2010/10/31/riak-smartmachine-benchmark-the-technical-details/

:

membase : membase, , - (membase , , , ). : , , (gen_server). - . riak.

, , .

: PostgreSQL. !

+2

bitcask Riak . IPC, , , Erlang.

0

All Articles