Answer the question
In order to leave comments, you need to log in
Should I use redis as temporary storage for game data? And is it worth changing mysql to postgreSQL?
For a browser-based card game (users perform some primitive actions no more than once every 1-2 seconds, 500-1000 people are online), you need to choose a method for storing up-to-date game information. The project is powered by yii2 + nodejs. Basically, all requests go through ajax, are processed in yii2 and sent through redis to the nodejs server, which in turn sends all updates to users via websockets. Mysql is currently used to store information about users. It also has tables with the data of completed game sessions. It is necessary to understand whether it makes sense to use redis to store data from actual game sessions in order to improve performance (architecture complexity, which can lead to some errors) or 300-400 requests per second to mysql is not a critical load for one server (there will be a separate table for actual sessions, there will be no more than 50-100 actual gaming sessions, respectively, there will be no more than 100 rows, in theory, the sampling will be very fast). I would also like to understand if postgreSQL has a performance advantage over mysql (advanced functionality is not required). If mysql is enough for this task, then it would be preferable to use it. I would also like to understand if postgreSQL has a performance advantage over mysql (advanced functionality is not required). If mysql is enough for this task, then it would be preferable to use it. I would also like to understand if postgreSQL has a performance advantage over mysql (advanced functionality is not required). If mysql is enough for this task, then it would be preferable to use it.
Answer the question
In order to leave comments, you need to log in
300-400 запросов в секунду для примитивных запросов не будет проблемой для mysql. Разумеется если будут настроены нужные индексы и кеширование запросов, особенно если хар-ки сервера позволят их полностью хранить в ОЗУ. Я бы отдал предпочтение тому, с чем лучше знакомы разработчики и админ. Усложнять логику, менять технологии и увеличивать риски без веских причин, моё мнение, не имеет смысла.
онлайн 500-1000 человек
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question