Is caching player save files a valid use case for Redis?

Viewed 14

I have an API hosted on a server which interacts with a game client.

My game client might send a request to “complete a level” and my server then needs to update the player’s savefile.

I want this savefile to be persistent, so I’m probably going to store its data in an SQL database backend. But then, every time the server gets the aforementioned request, it’ll have to query the DB to read the savefile, update the relevant data in-memory, then write to the DB to save the changes.

It has occurred to me that I could use Redis to maintain a ‘mirror/cached copy’ of the savefile in-memory, so that the server can read it faster instead of running a query on the DB. The server would then have to update the Redis DB and the SQL DB simultaneously once the update logic is performed.

My question is — does this seem like a good use case for Redis/an in-memory database in general? Even if so, is using Redis likely to yield enough performance benefit to be worth the extra hassle from a performance standpoint? (Possibly relevant info to inform the second question: The SQL backend is likely to be MS SQL running in a separate container to the server. I would like the server to be able to support many concurrent users and requests.)

0 Answers
Related