Right now, the back-end is talking to the RC API for many requests, which makes those requests take a lot longer than we would like, particularly when a request requires multiple RC API calls. Instead, we should keep all the data about recurser profiles in our database, and sync it periodically using a personal access token assigned to the application. This is a pattern that we've used elsewhere: in Faces, in Portfolio, and in World of Recurse.
Approximately, this work involves:
Rip out all the caching code
Set up a new table, profiles, stints?, batches?
we might not need batches at all, and instead just use the information in stints
we might want to keep stints denormalized (as a jsonb column), just to save rows, but see also below
Set up a nightly job to update every profile in the database -> Heroku scheduled task
this will have to be somewhat specific to this repo, because we're using a different ORM than those other projects
rewrite fns to use this new data instead of API calls
This will cause us to use a lot more rows in the database, which may impact our ability to stay on the free plan. We should chat with @mjec about the possibility of moving to a paid plan, and/or with RC staff about getting this project subsidized.
Right now, the back-end is talking to the RC API for many requests, which makes those requests take a lot longer than we would like, particularly when a request requires multiple RC API calls. Instead, we should keep all the data about recurser profiles in our database, and sync it periodically using a personal access token assigned to the application. This is a pattern that we've used elsewhere: in Faces, in Portfolio, and in World of Recurse.
Approximately, this work involves:
jsonb
column), just to save rows, but see also belowThis will cause us to use a lot more rows in the database, which may impact our ability to stay on the free plan. We should chat with @mjec about the possibility of moving to a paid plan, and/or with RC staff about getting this project subsidized.