sidequestjs / sidequestjs/sidequest
Add support for transactional job enqueuing
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1k
- Forks
- 25
- Avg merge
- 12h 17m
- Merged PRs (30d)
- 5
Description
Hello there,
For my current project, I am looking for a solution like Sidequest.js for handling async jobs using my existing PostgreSQL database.
What is preventing me from using Sidequest.js is that I need the enqueued jobs to be committed in the same transaction as my business logic.
In my experience, this pattern provides multiple benefits:
- It avoids race conditions that can happen when the job is being processed right after being enqueued, while your business entities might have not been committed yet
- For bigger workflows with multiple jobs being enqueued in a single request, any error happening after enqueuing jobs will trigger a rollback, which avoids jobs being processed multiple times when the system retries the operation
I could write my own query to enqueue the job and be done with it, but I deeply think Sidequest should provide this feature to its users and help them make their system more robust. IMO, the main advantage of using your current DB as a message broker is to keep your data and workflows strongly consistent.
I'd love to implement this change if it fits Sidequest.js vision. 😊
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or specific entry points. Start by locating Sidequest.js's job-enqueue path and database transaction handling, then determine how callers would share a transaction with business logic. Done means jobs and related business changes commit or roll back together, with tests covering both outcomes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, postgresql, typescript
- Domain
- backend, databases, distributed-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100