Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6731963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:35:31+00:00 2026-05-26T10:35:31+00:00

I aim to create a browser game where players can set up buildings. Each

  • 0

I aim to create a browser game where players can set up buildings.

Each building will have several modules (engines, offices,production lines, …). Each module will have enentually one or more actions running, like creation of 2OO ‘item X’ with ingredients Y, Z.

The game server will be set up with erlang : An OTP application as the server itself, and nitrogen as the web front.
I need persistence of data. I was thinking about the following :

When somebody or something interacts with a building, or a timer representing some production line ends up, a supervisor spawns a gen_server (if not already spawned) which loads the state of the building from a database, so the gen_server can answer messages like ‘add this module’, ‘starts this action’, ‘store this production to warehouse’, ‘die’, etc. (

But when a building don’t receive any messages during X seconds or minutes, he will terminate (thanks to the gen_server timeout feature) and drop its current state back to the database.

So, as it will be a (soft) real time game, the gen_server must be set up very fastly. I was thinking of membase as the database, because it’s known to have very good response time.

My question is : when a gen server is up an running, his states fills some memory, and this state is present in the memory handled by membase too, so the state use two times his size in memory. Is that a bad design ?

Is membase a good solution to handle persistence in my case ? would be use mnesia a better choice , or something else ?

I fear mnesia 2 Go (or 4 ?) table size limit because i don’t know at the moment the average state size of my gen_servers (buildings in this example, butalso players, production lines, whatever) and i may have someday more than 1 player 🙂

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:35:32+00:00Added an answer on May 26, 2026 at 10:35 am

    I agree with Hynek -Pichi- Vychodil. Riak is a great thing for key-valye storage.

    We use Riak almost 95% for the same thing you described. Everything works so far without any issues. In case you will hit performance limitation of Riak – add more nodes and it good to go!

    Another cool thing about Riak is its very low performance degradation over the time. You can find more information about benchmarking Riak here: http://joyeur.com/2010/10/31/riak-smartmachine-benchmark-the-technical-details/

    In case you go with it:

    • a driver: https://github.com/basho/riak-erlang-client
    • a connection pool you may need to work with it: https://github.com/dweldon/riakpool

    About membase and memory usage: I also tried membase, but I found that it is not suitable for my tasks – (membase declares fault tolerance, but I could not setup it in the way it should work with faults, even with help from membase guys I didn’t succeed). So at the moment I use the following architecture: All players that are online and play the game are presented as player-processes (gen_server). All data data and business logic for each player is in its player-process. From time to time each player-process desides to save its state in riak.

    So far seems to be very fast and efficient approach.

    Update: Now we are with PostgreSQL. It is awesome!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What I can do: I aim to create a view where a User Control
My overall aim is to create an editor which I can skin using jQuery
I am set to create a file explorer using Java. The aim is to
My aim is to create an application whereby a user can drag a label
To put this in concise language... Aim: To create a class which can load
I'm working on a simple crawler in Python. The aim is to create a
Is it possible to create types like e.g. String(20) in scala? The aim would
Aim The aim is to a have a container DIV with a fixed height
I am trying to create a logic switch in Javascript. The aim is to
I want to create an Android application where a user can create an account

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.