I’m building a system for playing cards, and I’ve decided on a pub/sub system using SSE to keep the clients updated. A problem I’m facing is keeping messages around for later querying. One use case is a player joins a table mid game. I’d like to fetch all the events from the current hand and replay them for that user.
I’m currently using redis’ pub/sub, but the messages are entirely ephemeral. I’ve done some digging into rabbitMQ and it also seems to be the case. Kafka seems to have some replay functionality? I can’t tell if it’s as granular as I’d like, though.
Is it reasonable to expect persistence from my pub/sub layer? Or should I separate the logic? I could have a consumer running just to take the events and store them. That just seems heavy, though, with too much opportunity for failure.
I’d also like to query the old events for stats on the players, and the cards played. Speed isn’t a factor on those queries, though.