-
Notifications
You must be signed in to change notification settings - Fork 240
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
Add hybrid method for tutorial storage #518
base: main
Are you sure you want to change the base?
Conversation
Just to add to Eli's notes a little:
This is working quite well for us in practice so we're hoping that this can be of benefit to other users of learnr! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @elimillera and @mstackhouse. I think it's a very reasonable feature request and I like the idea of it. I've looked at the PR a couple of times but haven't had the time required to dig into it.
I will share that my initial thoughts are that, as a hybrid storage system, I would really like to see the feature rely more on the other storage functions. I'll admit I haven't tried to implement it, but I'd really like to see a hybrid_storage()
function that delegates to filesystem_storage()
and client_storage()
.
I have reservations, therefore, about bringing an entirely new storage system with a unique implementation. In the long term, I think it'd be difficult to maintain and keep the hybrid system in line with the client and filesystem storage methods.
Of course, please do let me know if I'm missing something in my understanding.
|
Hybrid Storage
We discovered when we deployed learnr tutorials to a hosted environment that certain parts of the tutorial would take a long time(30-45 seconds) to initialized. This was because we were using the 'filesystem' option when storing user data and the filesystem was a lot slower as the tutorials got larger and more users accessed it at once. This also provides a fallback if the user deletes their cookies or is blocking them.
Our solution was to combine the client and filesystem methods. This has worked very well for us and we're hoping to contribute it back to the package.
Functions in hybrid_storage are a combination of client and filesystem storage with the exception of get_objects. get_objects includes logic to restore the state in the filesystem to the client storage if there are zero or one items in the client storage.
PR task list:
devtools::document()