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

Training content should be stored in the database #1615

Closed
ragesoss opened this issue Jan 18, 2018 · 5 comments
Closed

Training content should be stored in the database #1615

ragesoss opened this issue Jan 18, 2018 · 5 comments

Comments

@ragesoss
Copy link
Member

We've been gradually stretching the TrainingModule, TrainingLibrary, and TrainingSlide classes beyond their original design, and the storage strategy is breaking down for the on-wiki training modules on P&E Dashboard.

We currently import training module content from the wiki, and we cache the entire collection of TrainingLibrary.all, TrainingModule.all, and TrainingSlide.all in respective Rails cache keys. This means that updating the content is more complex and interdependent than it ought to be, and we're running up against the (default) limits of our cache infrastructure as well. (By default memcached has a 1M limit on file size, and P&E Dashboard now requires more than that. For now, I've increased the max memcached file size on the server.)

We should instead be storing all the training content in ActiveRecord, I think. We could then easily update individual slides and modules without worrying as much about the interdependence. A slide belongs to a module, and a module belongs to a library. Easy peasy.

This will involve:

  • Turning the training classes into ActiveRecord models (and maybe turn TrainingBase into a module).
  • Updating TrainingLoader to work with those models and their relations.
@ragesoss
Copy link
Member Author

@bcb37 FYI, in case you haven't seen it, this is related to the work you've been doing.

@bcb37
Copy link
Contributor

bcb37 commented Jan 27, 2018

Yeah, I have come up against the memcached limit. This makes a lot of sense. I could take it on next.

@ragesoss
Copy link
Member Author

ragesoss commented Oct 3, 2018

This has been done for TrainingSlide. TrainingModule and TrainingLibrary ought to be converted to ActiveRecord at some point, but for now they aren't causing any real problems.

@ragesoss
Copy link
Member Author

ragesoss commented Dec 6, 2018

This is done for TrainingModule, so only TrainingLibrary is left.

@ragesoss
Copy link
Member Author

Done, thanks to @AmitJoki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants