N
N
No_Time2012-11-15 17:30:54
Game development
No_Time, 2012-11-15 17:30:54

What architecture to choose for the backend of a mobile online game?

Good evening!
We all know that there are a bunch of city builders for various mobile platforms. Everywhere it is necessary to perform any actions after a given period of time. Google suggests a lot of information about how to build a cluster, how best to split the database into tablets, about the fact that the plot is the main thing in the game. But he is silent like a fish about how to implement these same wait timers correctly. After previous questions to Habr and my thoughts, several options were drawn:
1) Store the end time in the database, and from time to time pull the server
2) Use the timers built into node.js, if you believe the api description, then if they are at least 1kk everything should be ok(?)
3) Redis+Resque - it seems to be a very easy solution to implement, but I did not find any information on how expedient (economical) it is
4) RabbitMQ - there it seems possible to organize the delivery of messages after delay, which seems very good, given its good scalability
. Which option is better? Can you tell me where I can read about my task? Or perhaps even open source examples? It seems like there should be ready-made libraries or frameworks for this business, because there are millions of such toys, it's hard to believe that everyone writes their own implementation?!
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Q
qxfusion, 2012-11-15
@qxfusion

1) theoretically possible, but isn't it easier to allocate a time server based on NTP + JSONP API to it?
2) node.js dies already at more than 50 timers, i.e. in principle, work is possible, BUT it will not get 100% high-precision time (I wrote the project - I KNOW, you will definitely lose ms, and with a large number of clients the error can be up to 10s)
3) why not MemcacheDB + MemcacheQ = DB + Queues
4) RabbitMQ is the most - especially good in failover mode

S
sdevalex, 2012-11-15
@sdevalex

> 2) Use the timers built into node.js, if you believe the api description, then if there are at least 1kk, everything should be ok (?)
If the server crashes, then all the timers will fly off.
3) Redis+Resque - it seems to be a very simple solution to implement, but I did not find information on how expedient (economical) it is.
An excellent solution if maximum performance is not needed.
Do you have a question more on the topic “How and where to store a list of tasks?” or I misunderstood?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question