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

The one transaction per request model can hold connections for too long #3449

Open
sandhose opened this issue Oct 30, 2024 · 0 comments
Open
Labels
A-Scaling Related to performance and scaling

Comments

@sandhose
Copy link
Member

We currently have a simple model of opening a database transaction for each HTTP request.
This has the benefit of ensuring database consistency through the whole request, and avoid unnecessary waits for database connections to be available mid-request.

This has the downside of potentially holding a database connection open for a long time, if during the request we're calling to external systems, like the upstream OAuth 2.0 provider.

We need to rethink this system to allow a more granular access to the database. I think we should start the database transactions explicitly within the request, so that it's possible to split the request into two separate transactions

@sandhose sandhose added the A-Scaling Related to performance and scaling label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Scaling Related to performance and scaling
Projects
None yet
Development

No branches or pull requests

1 participant