faststream icon indicating copy to clipboard operation
faststream copied to clipboard

PostgreSQL support

Open Vad1mo opened this issue 1 year ago • 7 comments

Is your feature request related to a problem? Please describe.

I am aware that PostgreSQL is now a Message Queue per se; however, it can be utilized as such. Many developers realize that it suffices for the majority of tasks, and it comes with zero added costs if a PostgreSQL db is present.

Describe the solution you'd like Clearly and concisely describe the desired outcome or solution.

Feature code example Nothing in particular

Describe alternatives you've considered You can do exactly this with MySQL and SQL server too because they both support SKIP LOCKED.

Additional context

  • https://adriano.fyi/posts/2023-09-24-choose-postgres-queue-technology/
  • https://www.prequel.co/blog/sql-maxis-why-we-ditched-rabbitmq-and-replaced-it-with-a-postgres-queue
  • https://dagster.io/blog/skip-kafka-use-postgres-message-queue

Vad1mo avatar Oct 04 '23 12:10 Vad1mo

@Vad1mo :wave: I came across this by chance and see you've referenced my write up on the topic of PG as a queue.

If you find Go easy enough to read, you might benefit from reading the neoq source (https://github.com/acaloiaro/neoq) as a reference implementation for the ideas lain out in my post. The whole PG implementation is contained within: https://github.com/acaloiaro/neoq/blob/main/backends/postgres/postgres_backend.go

Cheers!

acaloiaro avatar Nov 01 '23 02:11 acaloiaro

@Vad1mo :wave: I came across this by chance and see you've referenced my write up on the topic of PG as a queue.

If you find Go easy enough to read, you might benefit from reading the neoq source (https://github.com/acaloiaro/neoq) as a reference implementation for the ideas lain out in my post. The whole PG implementation is contained within: https://github.com/acaloiaro/neoq/blob/main/backends/postgres/postgres_backend.go

Cheers!

Found it already 👀 https://github.com/acaloiaro/neoq/issues/70 🤣

Vad1mo avatar Nov 01 '23 05:11 Vad1mo

I don't like an idea to poll DB for updates I am thinking about Listen/Notify PG feature or even CDC (replication journal) consuming

Lancetnik avatar Nov 24 '23 17:11 Lancetnik

Yes, I was referring to listen/notify. No mention about polling. Regarding CDC, here I am not sure how or if it is low level, hence if it can be easily setup within the offerings of cloud providers.

Vad1mo avatar Nov 24 '23 18:11 Vad1mo

CDC available from any pg driver: asyncpg/psycopg/etc It is just a part of protocol So, it can be a useful feature as I can image

Lancetnik avatar Nov 24 '23 19:11 Lancetnik

Hey guys! I really need it asap. R u planning to implement it in nearest future or should I search other tools for manage pg listen/notify queues?

mixartemev avatar Aug 12 '24 14:08 mixartemev

Hey guys! I really need it asap. R u planning to implement it in nearest future or should I search other tools for manage pg listen/notify queues?

Sorry, I don't think, that we can add Postgres support this year. Probably, we can do it in the first half of 2025, but can't strongly promise 😢

Lancetnik avatar Aug 13 '24 09:08 Lancetnik