I have noticed countless messages that discuss the architectural design of nodes, networks, middleware, databases, and how the clients (as in a game client on a phone, browser, console, PC, etc) should read and write data.

My question here relates to who the client should be directly connecting to. For writes, I take the road that you don't want to trust a client to do safe things to a database or even a cache (like REDIS) so you would simply not let the client do that.

But there are interesting possibilities for a client to talk to a db or cache only to read data. I can see leaderboards, game server locations, and even dynamic MMO state data being validly put onto a bunch of READ-ONLY caches (obviously, a server entity will be able to update these caches) being potential use cases where the client gains performance economies by reading from this cache directly.

Which use cases make sense? If you want to give examples, that's fine but I know I am supposed to stick to one question at a time here, so if you are giving an example, please give it in the context of a use case.

  • \$\begingroup\$ This looks like an open-ended "list all cases of..." question, which can be an awkward fit for the one-acceoted-answer model we use here. Can you clarify what specific use case you're solving for in your current project? Have you encountered a situation where you're tempted to let the client read directly from the cache, but have observed/anticipated specific problems when you allow this? Remember, StackExchange is better at troubleshooting and solving specific problems that have been demonstrated, than it is a predicting what problems might occur in the indefinite future in unknown cases. \$\endgroup\$ – DMGregory Feb 12 at 10:24
  • \$\begingroup\$ I am looking at a situation where I have game clients all over the world and they want to access read-only data, but the current architecture is such that they can only go back to a database sitting in a single data center to get this data. It is a slow and inefficient bottleneck. I am considering the idea of deploying some Redis cache instances in places all over the world and letting these clients read directly from these instances. I would like to know if this is safe or am I going way out in left field by trying this. \$\endgroup\$ – Neeraj Murarka Feb 13 at 3:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.