Configure DB read replica and routing - #1227
Conversation
| SQLALCHEMY_DATABASE_URI = "postgresql+psycopg2://zenodo:zenodo@localhost/zenodo" | ||
|
|
||
| # fmt: off | ||
| ZENODO_UI_READ_ONLY_ENDPOINTS = [ |
There was a problem hiding this comment.
These need a second look. I removed from the initiali list all the POST/PUT/DELETE routes and did a manual pass to make sure none of these routes have hidden DB writes (like e.g. the /confirm route).
There was a problem hiding this comment.
Are you observing high traffic in all these endpoints? Otherwise you can evaluate adding only a subset of those and then progressively expanding it.
There was a problem hiding this comment.
Not really, but I thought narrowing down all the read endpoints and filtering afterwards will make sure we don't miss anything (like e.g. the legacy redirect endpoints, which are linked to around the web already).
| if IS_LOCAL_DEV: | ||
| SQLALCHEMY_BINDS = { | ||
| "read_replica": "postgresql+psycopg2://zenodo_ro:zenodo_ro@localhost/zenodo" | ||
| } | ||
|
|
||
| DB_SESSION_BIND_FUNC = routed_bind |
There was a problem hiding this comment.
This needs some additional thought regarding how it will be rolled out for QA/Production via env config
29ad5d4 to
b7eeffa
Compare
Uh oh!
There was an error while loading. Please reload this page.