How to cache player data during session?

nakama Every rpc operation to modify player data requires operating the db. This kind of DB operation is very stressful. Is there any way to store player data in memory, which has the same life cycle as the session cycle of player login? Can developers implement it according to the Linux mechanism?

Hello @hexun80149128,

Nakama database operations are optimized as best as possible, you shouldn’t worry about it too much as long as you’re using sane read/write operations in your RPCs.

Depending on the type of game, using authoritative matches (which run entirely in memory) might be the better option, and only persist any match outcomes or side-effects after the play loop ends.

Best.