Question

I'm completely new to distributed application design and am trying to do this test application to get some understanding on how it all works together. Thus I would appreciate any feedback on the following application design.

Problem:

Design a turn-based multiplayer game.

Possible implementation:

I'm thinking of the following high-level implementation/workflow:

Client (Mobile/Web/etc) <-> SignalR ASP MVC website <-> Azure/AWS MQ <-> Akka actors <-> DB

Each connected client will have a corresponding Player actor in Akka backend.

All requests/responses for a client would go through SignalR ASP frontend and delegated through message queue to appropriate backend actors.

All moves/state queries to the game would be made by those Player actors to corresponding Game actor in backend which will handle updating game state in DB.

Question:

Does that design make sense? Is it a correct use-case for Akka?

Was it helpful?

Solution

That design is certainly possible (I would not qualify use-cases as correct or incorrect), although SignalR/Azure/DB are not a priori necessary components: you could also build the front-end using Play framework (for example), use Akka Cluster and Distributed PubSub for messaging and Akka Persistence for storing the game world’s state. But any mix you might choose should work just fine. You can take a look at the Reactive Maps tutorial in Activator if you are interested in how it looks like to go “all in” with Akka.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top