commanded / eventstore

Event store using PostgreSQL for persistence
MIT License
1.06k stars 146 forks source link

Add polling option for subscriptions as a fallback when Postgres LISTEN / NOTIFY is unsupported #205

Open slashdotdash opened 4 years ago

slashdotdash commented 4 years ago

In certain environments Postgres’ built-in notification mechanism (LISTEN / NOTIFY) is not supported. This might be due to using an external connection pool, such as pgbouncer, or limitations of a managed Postgres service.

To support these environments a fallback polling option could be provided where newly appended events are queried at a regular interval and published to subscribers. This would add additional latency to subscribers dependent upon the pool interval, which should be configurable. A short polling interval would reduce latency but add load to the database.

esse commented 2 years ago

any progress here? We're using commanded together with pgbouncer and it would make our life so much better!