-
Notifications
You must be signed in to change notification settings - Fork 97
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
[NFR] Read-only mode for maintenance #70
Comments
👍 It is very simple... It can depends on config option maintenance key, if this key is present Application.php will redirect to /public/maintenance.html (mb not redirect, mb just print file_get_contents())... BTW maintenance key can be a key, that can be entered at maintenance to access to working site (via current session). |
That would be possible even with simple .htaccess or nginx redirect. Just like stackoverflow does during maintenance to handle high-availability |
Yep, and why u can't restrict it via this maintenance key ?
But it must be accesible from admin panel. |
A few possible situations would be:
Basically everything which require database write. This enables you to send all reads to replicas while new master is being updated/prepared. |
Oh... u mean read-only access... didn't notice it in title of this issue... hm... |
I would image that such upgrade takes place on a separate master and a set of replicas (new environment) while read-only replicas serve read-only content (old environment) thus allowing for smooth upgrade. |
There is a wordpress plugin which tries to do this: And generally this has been discussed on SilverStripe's group: |
Yes... but this is for blog... in that context - it is easy.. but not in unfinished complex system, when final system will be never understanded for us. I can set this as "low"... but this feature may lead to different problems.. like when we will have extension store.. we will need to add label to modules, that will identity module as "read-only mode is supported" - that means, that market will have estimativly 50% / 50% supported modules and unsupported... it will be not very nice.. As for implementation - it seems to me quit simple - creating own db adapter, that will have "read-only" flag, when flag is enabled - all operations with INSERT/UPDATE will thrown a special exception type... and it will be special method that will check that flag for submodules... like if $db->isReadOnly()){ ... todo ... } .... if there will be no flag in controller (e.g. in blog creation form) - an exception will be thrown... while exception will have special type (if it unhandled) - a special error page will be shown, like... this part of system is currently under update.... something like that... |
If it was possible with a plugin that's even better. Please keep this open for now, I'll try experimenting with db adapter and/or plugin when I have a few spare minutes |
A simple switch somewhere in system config for read-only mode will be nice to have at some point.
This would be useful for times where some database maintenance is needed such as:
I'm not sure if it'd be possible to control each module globally with this option or if each module will have to implement this on its own.
The text was updated successfully, but these errors were encountered: