Hey, I’ve been making an online game project for a while. I use MongoDB almost for everything related to database. I’d like to explain how I cache player data in game.
Basically, when player joins the game, the mongo document saves in server memory as a cache and I use cache for almost everything realted to player data. For now, I use change stream to update cache; when the “player” collection update, insert or delete, change stream will update server cache.
Should I really trust “Change Stream” for a long time? Normally, online games are using sockets and rest API for datas but I’ve found the Change Stream more suits what I’m doing. In the future, if the project grows up, I’ll probably use sharding and other complicated things for database and I really don’t want to change my bone caching system. Therefore, I’d want to know I should trust change stream for a long time or not.