Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize Database Queries for Game State #98

Open
BrennanAyers opened this issue Sep 12, 2019 · 0 comments
Open

Optimize Database Queries for Game State #98

BrennanAyers opened this issue Sep 12, 2019 · 0 comments

Comments

@BrennanAyers
Copy link
Owner

With our current long-polling strategy for checking Game state on the Frontend, the number of Queries performed for every call, every 15 seconds, is massive. ActiveRecord needs to pull all public GameCards, their Card information, Player information, and call Player methods to determine cards in hand and topdeck of Discard.
While AR might have some built in caching/optimization, there still can definitely improve these calls.

  • Implement real caching: Cache keys will be based on Game.turn number to ensure they're always the current state of the Game
  • Short Cache expiration: 30 Minutes or less would ensure that data is not kept around too long, but also allows for people to stop playing for a period of time without the cache repopulating too much
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant