1
\$\begingroup\$

I'm making a discord bot which allows players to collect and duel cards. All the cards, players and other data is stored in MongoDB but where should I store duels data? Duels data will keep changing as player's make moves thus mongoDB might affect performance significantly.

Another issue is time mangement, a turn lasts for 60 seconds and duel lasts for 600 seconds, I can't update timer in mongoDB every 1 second to reflect how much time is left. I was previously using redis for these purposes but redis has really basic structure which causes code to become really messy thus making it extremely difficult to add new features.

What are your suggestions? How should I go about storing duel data?

Here's the data that I want to store:

  • duelID (String)
  • player1ID (String)
  • player2ID (String)
  • betAmount (Integer)
  • currentTurn (String)
  • currentPhase (String)
  • player1Health (Integer)
  • player2Health (Integer)
  • playedCharacterCard (Boolean)
  • player1Hand (Array<Objects>)
  • player2Hand (Array<Objects>)
  • player1Spots (Array<Objects>)
  • player2Spots (Array<Objects>)
\$\endgroup\$
1

0

You must log in to answer this question.

Browse other questions tagged .