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

Readonly mode for database #5693

Open
sminnee opened this issue Jun 14, 2016 · 7 comments
Open

Readonly mode for database #5693

sminnee opened this issue Jun 14, 2016 · 7 comments

Comments

@sminnee
Copy link
Member

sminnee commented Jun 14, 2016

As a sysadmin, I want to have a way of setting SilverStripe to readonly mode, so that I can safely reduce downtime during deployments

Acceptance criteria

  • Readonly mode can be activated by a config setting or an _ss_environment.php define.
  • When in readonly mode, the ORM returns sensible defaults about locking off edit rights to various features.
  • Where non-critical database edits occur (e.g. logging of log-ins), they can be silently skipped. Developers have a way of defining such cases.
  • Ensure that at the low level of the DB, writes and schema changes are blocked. DB::query("INSERT ...") shouldn't bypass this readonly-mode.
  • Where code hasn't been written to handle readonly mode, exceptions should be thrown. A config option exists to ignore all errors instead.
  • Dev docs are written
@fspringveldt
Copy link

fspringveldt commented Sep 1, 2016

Hi sminnee. I've created a module which checks 5/6 of the boxes and will continue working on it until 6/6 is achieved at https://github.com/fspringveldt/db-read-only-mode for review.

@sminnee
Copy link
Member Author

sminnee commented Sep 1, 2016

@tractorcow Franco's module looks good—you should check it out. :-)

@tractorcow
Copy link
Contributor

I've done a code review and it's excellent. :)

Take care: DBSchemaManager::query() will still invoke query on the UN-mocked database service, so make sure that your proxy injects itself into the schema instance as well.

@fspringveldt
Copy link

Thanks for the review and suggestion Damian.

I'll inject DBSchemaManager as well and write a test for it too.

Regards,
Franco

On 05 Sep 2016 05:04, "Damian Mooyman" [email protected] wrote:

I've done a code review and it's excellent. :)

Take care: DBSchemaManager::query() will still invoke query on the
UN-mocked database service, so make sure that your proxy injects itself
into the schema instance as well.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#5693 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKboGITE5GlrrrmbUacjwrSj275HhqnZks5qm4a3gaJpZM4I04tR
.

@dhensby
Copy link
Contributor

dhensby commented Nov 30, 2016

This has missed 3.5 and can't go into a new patch release. I highly doubt a 3.6 release will happen so this needs to target master. sorry.

@dhensby dhensby modified the milestones: 4.0.0, 3.5.0 Nov 30, 2016
@tractorcow
Copy link
Contributor

We might but probably won't have 3.6.

@sminnee
Copy link
Member Author

sminnee commented Nov 30, 2016

highly doubt a 3.6 release will happen so this needs to target master. sorry.

I disagree with this. SilverStripe 3.x is going to be supported until Dec 2018.

This is good for 3 and was posted here at my request.

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

7 participants