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

Session storage #82

Closed
gsproston-scottlogic opened this issue Jul 31, 2023 · 1 comment
Closed

Session storage #82

gsproston-scottlogic opened this issue Jul 31, 2023 · 1 comment
Labels
backend Requires work on the backend infra/devops Related to infrastructure or project config

Comments

@gsproston-scottlogic
Copy link
Contributor

gsproston-scottlogic commented Jul 31, 2023

Set up session storage when we go to production.

If using connect-redis for storage, this requires resave to be false and recommends saveUnitialized to be false in the session.

Update - 25/01/2024

There is the question of whether this is genuinely needed. Does game state really need to persist?

  • If someone has beaten the levels before, they should know how to do so again.
  • A session will stay active for as long as the user is interacting with the server, plus for a period of inactivity (currently 4hrs in prod). This should be fine for a typical session, even if the user leaves for a break and returns a while later.
  • The longer we persist sessions, the more storage we will be using, and the higher the costs.

Currently, sessions are stored in memory. We have a single container, because

  • AWS infrastructure is robust so we don't anticipate unexpected server restarts;
  • we don't anticipate high traffic needing to be load-balanced across multiple containers.

Therefore all sessions will be stored in memory on the same container, which feels easily good enough for now - until it isn't, at which point we could revisit this issue.

@gsproston-scottlogic gsproston-scottlogic added bug Something isn't working backend Requires work on the backend labels Jul 31, 2023
@chriswilty
Copy link
Member

chriswilty commented Oct 10, 2023

We would want to use ElastiCache with Redis, as Memcached does not offer redundancy/replication. They appear to be the same price anyway.

@chriswilty chriswilty added infra/devops Related to infrastructure or project config and removed bug Something isn't working web dev labels Nov 8, 2023
@chriswilty chriswilty closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Requires work on the backend infra/devops Related to infrastructure or project config
Projects
None yet
Development

No branches or pull requests

2 participants