optionally use alternate db connection for orm stuff (users/roles) #1180
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
on the live system, the prod api servers are used when creating new users -- either via the admin page, or when users register at our google form (which just posts to another admin url). users are added by the api servers as records in the
api_user
table and their roles are stored in the associateduser_role_link
table (and the role names themselves are stored in theuser_role
table, but it isnt updated very frequently). HOWEVER, the prod api servers use the prod db replicas, and the prod db replicas are set up to mirror any changes made to the prod master db. so if the api servers are creating/updating users on replicas, the user tables on the replicas will soon be out of sync with each other and the master 😞this change lets us (optionally) use an alternate db connection for the users/roles stuff. that way, we can have the prod api servers using the [distributed, loadbalanced, whatevs] db replicas for large epidata queries, but they can all use the master for user operations, eliminating the sync issues.