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

Feature Request: Stateless Mode #4

Open
moll-dev opened this issue Sep 25, 2024 · 0 comments
Open

Feature Request: Stateless Mode #4

moll-dev opened this issue Sep 25, 2024 · 0 comments

Comments

@moll-dev
Copy link

moll-dev commented Sep 25, 2024

Hey all,

I use Jetstream for a couple of services that I wrote for indexing likes / posts / etc. I was wondering if it's possible to have a stateless config for Jetstream that uses a consumer that doesn't write events to disk for replay. Might be nice to quickly scale up a bunch of instances that are just live tailing.

It should be pretty easy to do:

  1. Add a field (single flag or custom config struct) to the firehose Consumer, skip event persists in the RunSequencer goroutine.
  2. Add logic to bounce any clients that request a cursor before the current time.

Alternatively a "retention" config could be added to periodically clean the local RocksDB instance. And if the retention was set to 0 (seconds/minutes/days or events) it would skip the consumer DB entirely.

This should be a good start. As there's only one FH consumer per Server instance, I don't think the current code could support transparent subscriber requests to backfill.

I've got some cycles to work on this shortly, I don't have any urgent need for stateless, more of a performance experiment.
Let me know what you think!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant