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

Add Support for t.LOCK.UPDATE in Sequelize Transactions #2

Open
pushoo-sharma opened this issue Jan 2, 2024 · 0 comments
Open

Add Support for t.LOCK.UPDATE in Sequelize Transactions #2

pushoo-sharma opened this issue Jan 2, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@pushoo-sharma
Copy link
Owner

The current implementation of Sequelize transactions allows for the use of various lock modes to manage concurrent access. However, the explicit t.LOCK.UPDATE option is not yet documented or supported. This feature is crucial for scenarios where exclusive locks are required to prevent concurrent updates to a specific database row.

Downsides and Considerations

  1. Increased Contention:

    • The use of exclusive locks with t.LOCK.UPDATE can potentially lead to increased contention, especially in high-traffic scenarios, as transactions will be waiting for exclusive access.
  2. Performance Impact:

    • Exclusive locks have a performance impact, and careful consideration should be given to the trade-off between data consistency and system performance.
  3. Deadlocks:

    • Explicit use of exclusive locks may increase the likelihood of deadlocks, and proper strategies should be in place to handle and resolve deadlocks when they occur.

Additional Considerations

  1. Guidelines for Usage:

    • Provide guidelines in the documentation on when to use t.LOCK.UPDATE and considerations for scenarios with potential contention.
  2. Community Feedback:

    • Encourage community feedback on the use of t.LOCK.UPDATE in different scenarios to gather insights into its effectiveness and potential issues.

Expected Outcome

The explicit documentation and support for the t.LOCK.UPDATE option in Sequelize transactions will empower developers to make informed decisions about when to use exclusive locks. It's essential to highlight potential downsides and considerations to guide in using this feature judiciously.

Related Links

@pushoo-sharma pushoo-sharma self-assigned this Jan 2, 2024
@pushoo-sharma pushoo-sharma added the enhancement New feature or request label Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant