riverqueue / riverqueue/river

River leader in multi-service ecosystem

Open
#742 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
5.7k
Forks
179
Avg merge
15h 43m
Merged PRs (30d)
13

Description

Hey folks,
I've the following use case and I would like to hear your opinion on a limitation I faced once starting to tackle it.
I'm dealing with microservices architecture where N services would like to schedule periodic jobs (independently).
The services are compute distributed with centralized single DB instance (multi schema).
Meaning - each service creates a river client and set its internal scheduling jobs (worth to mention, each service defines its scheduling job kind).
In this scenario with the current leader election process there is a race between the services on the leadership ownership.
Let's assume service N_1 assigned to be the leader, as a result services N_2....,k schedule jobs will be starved (and actually won't run).
Are you aware of this limitation?
There is an alternative to achieve the requirements described aforementioned?
Thanks in advanced.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading River's current leader-election and periodic-job scheduling behavior for multiple clients sharing one PostgreSQL database. Determine whether independently scheduled jobs can run for each service, then document a supported approach or define the scope of a change that prevents non-leader services' jobs from being starved.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
databases, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.