Please give me some advise? (Akka Sharding & Akka Persistence)
Hi all,
I’m building a service for mobile Game using Akka, WebSocket like this
So in this cluster i have
- WebSocketActor
- This actor create when device of user connect to service via WebSocket (1 user maybe have many devices)
- UserActor
- UserActor will be create in UserShard when WebSocket tell first message to UserActor with userId
- When UserActor receive mesasge from WebSocketActor will keep ActorRef of this WebSocketActor
Example
- Node 1:
- WebSocketActor1, WebSocketActor2
- Node 2:
- UserActor1
- Node 3:
- UserActor2
So if i kill Node 3 => UserActor2 will lost connection with WebSocketActor2
Then i want to use Akka Persistence to store state of UserActor and recover when it restart on another node
Please tell me this solution good or not?
If good should i use kind of Akka Persistence (some choice: https://index.scala-lang.org/search?topics=akka-persistence&q=*&page=1)
- akka/akka-persistence-cassandra
- safety-data/akka-persistence-redis
- dnvriend/akka-persistence-inmemory (https://github.com/dnvriend/akka-persistence-inmemory)