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

Investigate data stored in XP systems service runtime #689

Open
tsa96 opened this issue Jan 11, 2023 · 4 comments
Open

Investigate data stored in XP systems service runtime #689

tsa96 opened this issue Jan 11, 2023 · 4 comments
Labels
For: Backend This is something to do for the backend (server folder) of the website. Priority: Medium Something that should be tried to be done in this release, but not as important as High priority. Type: Dev/Internal Something that is more internal to development than end user facing. Type: Question

Comments

@tsa96
Copy link
Member

tsa96 commented Jan 11, 2023

We've written the XP systems service to work essentially the same way as the old API: on init the app reads the stored XP system variables from the DB, then stores in memory throughout the app's lifetime, to avoid constantly querying the DB. When an admin updates the XP system variables, it updates both in memory and on the DB.

Immediately had concerns when rewriting this - how is this going to work for multiple deploys? Not sure the best solution, but definitely something we need to consider. Frankly, I find it quite weird we have a live endpoint for updating something as major as the XP system variables, almost seems significant enough that a restart would be appropriate.

@tsa96 tsa96 added Priority: Medium Something that should be tried to be done in this release, but not as important as High priority. Type: Dev/Internal Something that is more internal to development than end user facing. For: Backend This is something to do for the backend (server folder) of the website. Type: Question labels Jan 11, 2023
@riesha
Copy link

riesha commented May 7, 2023

Is using redis not an option? It’s pretty much perfect if you want to scale across deploys and it’s what I used on one of my mod projects for leaderboards and player stats and I think it’d work great for momentum

@tsa96
Copy link
Member Author

tsa96 commented May 7, 2023

Yup, Redis seems pretty likely. This is a bit of a funny issue, I made it just to keep track of AFAIK the only service we currently have that's facing this problem. In the future we're likely to need:

  • Additional services that share in-memory state across instances (so Redis async replication is a standard solution)
  • For caching, for whole responses (using NestJS's caching module) as well of potentially other very frequently accessed data
  • As a pub/sub message broker, especially if we start writing some non-NestJS services such as parts of the ranking system

I've never used Redis personally (and AFAIK neither has Goc), but seems like good solution for all these things, and should integrate nicely into our stack. It depends on deploy stuff quite a bit, which we need to hash out more, but especially after 0.10.0 this is something we'll be giving a lot of thought to.

@riesha
Copy link

riesha commented May 7, 2023

Ohh thats great then !! if you guys need any help for that stuff in the future i'd be happy to help in any way i can!

@tsa96
Copy link
Member Author

tsa96 commented May 7, 2023

Awesome! Best place to talk with us is in our discord in the #website channel (assign yourself the "Web" role in # Channels and roles to be able to talk). We're going to go through and really clean up the issues boards once the current rewrite is complete, soon after my nx branch is in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For: Backend This is something to do for the backend (server folder) of the website. Priority: Medium Something that should be tried to be done in this release, but not as important as High priority. Type: Dev/Internal Something that is more internal to development than end user facing. Type: Question
Projects
None yet
Development

No branches or pull requests

2 participants