TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: An SQS Alternative on Postgres

241 点作者 chuckhend大约 1 年前

22 条评论

bastawhiz大约 1 年前
&gt; Guaranteed &quot;exactly once&quot; delivery of messages to a consumer within a visibility timeout<p>That&#x27;s not going to be true. It might be true when things are running well, but when it fails, it&#x27;ll either be at most once or at least once. You don&#x27;t build for the steady state, you build against the failure mode. That&#x27;s an important deciding factor in whether you choose a system: you can accept duplicates gracefully or you can accept some amount of data loss.<p>Without reviewing all of the code, it&#x27;s not possible to say what this actually is, but since it seems like it&#x27;s up to the implementor to set up replication, I suspect this is an at-most-once queue (if the client receives a response before the server has replicated the data and the server is destroyed, the data is lost). But depending on the diligence of the developer, it could be that this provides no real guarantees (0-N deliveries).
评论 #40309227 未加载
评论 #40312136 未加载
评论 #40309101 未加载
评论 #40309615 未加载
评论 #40309143 未加载
评论 #40313094 未加载
pyuser583大约 1 年前
What advantages does this have over RabbitMQ?<p>My experience is Postgres queuing makes sense you must extract or persist in the same Postgres instance.<p>Otherwise, there’s no advantage over standard MQ systems.<p>Is there something I don’t know.
评论 #40309041 未加载
评论 #40309609 未加载
评论 #40310518 未加载
评论 #40309802 未加载
评论 #40312243 未加载
ltbarcly3大约 1 年前
Another one of these! It&#x27;s interesting how many times this has been made and abandoned and made again.<p><a href="https:&#x2F;&#x2F;wiki.postgresql.org&#x2F;wiki&#x2F;PGQ_Tutorial" rel="nofollow">https:&#x2F;&#x2F;wiki.postgresql.org&#x2F;wiki&#x2F;PGQ_Tutorial</a> <a href="https:&#x2F;&#x2F;github.com&#x2F;florentx&#x2F;pgqueue">https:&#x2F;&#x2F;github.com&#x2F;florentx&#x2F;pgqueue</a> <a href="https:&#x2F;&#x2F;github.com&#x2F;cirello-io&#x2F;pgqueue">https:&#x2F;&#x2F;github.com&#x2F;cirello-io&#x2F;pgqueue</a><p>Hundreds of them! We have a home grown one called PGQ at work here also.<p>It&#x27;s a good idea and easy to implement, but still valuable to have implemented already. Cool project.
评论 #40309937 未加载
评论 #40309672 未加载
评论 #40312160 未加载
RedShift1大约 1 年前
This seems like a lot of fluff for basically SELECT ... FROM queue FOR UPDATE SKIP LOCKED? Why is is the extension needed when all it does is run some management type SQL?
评论 #40313780 未加载
评论 #40314144 未加载
conroy大约 1 年前
I&#x27;m curious how this performs compared to River <a href="https:&#x2F;&#x2F;riverqueue.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;riverqueue.com&#x2F;</a> <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=38349716">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=38349716</a>
评论 #40309753 未加载
kelnos大约 1 年前
Perhaps we were all just not good at database&#x27;ing, but at a previous job, &quot;using RDBMS as a queue&quot; became a meme&#x2F;shorthand for &quot;terrible idea that needs to be stamped out immediately&quot;.<p>Does Postgres have some features that make it not entirely unsuitable to use for queuing?
评论 #40317213 未加载
评论 #40315974 未加载
dostoevsky013大约 1 年前
I’m not sure what are the benefits for the micro service architecture. Do you expect other services&#x2F;domains to connect to your database to listen for events? How does it scale if you have several micro services that need to publish events?<p>Or do you expect to a dedicated database to be maintained for this queue? Worth comparing it with other queue systems that persist messages and can help you to scale message processing like kafka with topic partitions.<p>Found this article on how Revolut uses Postgres for events processing: <a href="https:&#x2F;&#x2F;medium.com&#x2F;revolut&#x2F;recording-more-events-but-where-will-we-store-them-4b1dad457cf5" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;revolut&#x2F;recording-more-events-but-where-w...</a>
评论 #40315980 未加载
评论 #40310547 未加载
anentropic大约 1 年前
One of the appeals of doing MQ in Postgres is being able to submit events atomically in same db transaction as the stuff that raised the event<p>Looking at <a href="https:&#x2F;&#x2F;github.com&#x2F;tembo-io&#x2F;pgmq&#x2F;tree&#x2F;main&#x2F;tembo-pgmq-python">https:&#x2F;&#x2F;github.com&#x2F;tembo-io&#x2F;pgmq&#x2F;tree&#x2F;main&#x2F;tembo-pgmq-python</a> ...how do I integrate the queue ops with my other db access code?<p>Or is it better not to use the client lib in that scenario and use the SQL functions directly? <a href="https:&#x2F;&#x2F;github.com&#x2F;tembo-io&#x2F;pgmq?tab=readme-ov-file#send-two-messages">https:&#x2F;&#x2F;github.com&#x2F;tembo-io&#x2F;pgmq?tab=readme-ov-file#send-two...</a>
评论 #40320931 未加载
cynicalsecurity大约 1 年前
But why? Why not have a proper SQS service? What&#x27;s the obsession with Postgres?
评论 #40312454 未加载
评论 #40313177 未加载
评论 #40315030 未加载
评论 #40316046 未加载
评论 #40313180 未加载
评论 #40311630 未加载
lloydatkinson大约 1 年前
For the longest time the common advice was that using a database as a message queue&#x2F;broker was a bad idea. Now, everyone seems keen to use a DB for this instead of tools dedicated to this purpose. Why?
评论 #40316884 未加载
pulkitsh1234大约 1 年前
A client is supposed to poll the queue for new items (i.e. issue pop requests in a loop), or is there some better event-oriented approach for this (via pg notify ?)
评论 #40321010 未加载
评论 #40317466 未加载
thangngoc89大约 1 年前
I’m wondering if there are language agnostic queues where the queue consumers and publishers could be written in different languages?
评论 #40309443 未加载
评论 #40309221 未加载
deepsun大约 1 年前
&gt; TIMESTAMP WITH TIME ZONE<p>I&#x27;m yet to find a use case for &quot;WITH TIME ZONE&quot;, in all cases it&#x27;s better to use &quot;WITHOUT TIME ZONE&quot;. All it does is displays the date in sql client local timezone, which should never matter for well done service. Would be glad to learn otherwise.
评论 #40315875 未加载
评论 #40316277 未加载
评论 #40316104 未加载
bdcravens大约 1 年前
Note there are a number of background job processors for specific languages&#x2F;frameworks that use Postgresql as the broker. For example GoodJob and the upcoming SolidQueue in Ruby and Rails.
rco8786大约 1 年前
This is neat. Would be cool if there was support for a dead letter or retry queue. The idea of deleting an event transactionally with the result of processing said event is pretty nice.
评论 #40310227 未加载
justinclift大约 1 年前
As a data point, there&#x27;s a similar Go based project called Neoq:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;acaloiaro&#x2F;neoq">https:&#x2F;&#x2F;github.com&#x2F;acaloiaro&#x2F;neoq</a>
andrewstuart大约 1 年前
Seems an unusual choice that this does not have an HTTP interface.<p>HTTP is really the perfect client agnostic super simple way to interface with a message queue.
评论 #40316061 未加载
airocker大约 1 年前
I think it will be better if you create events automatically based on commit events in wal.
ComputerGuru大约 1 年前
This is strictly polling, no push or long poll support?
评论 #40314133 未加载
junail大约 1 年前
sounds interesting, is there a timeout? or batch processing?
评论 #40321041 未加载
jilles大约 1 年前
Can someone tell me what the usefulness of this is compared to RabbitMQ or Kafka?
seveibar大约 1 年前
People considering this project should also probably consider Graphile Worker[1] I&#x27;ve scaled Graphile Worker to 10m daily jobs just fine<p>The behavior of this library is a bit different and in some ways a bit lower level. If you are using something like this, expect to get very intimate with it as you scale- a lot of times your custom workload would really benefit from a custom index and it&#x27;s handy to understand how the underlying system works.<p>[1] <a href="https:&#x2F;&#x2F;worker.graphile.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;worker.graphile.org&#x2F;</a>
评论 #40309265 未加载
评论 #40315847 未加载
评论 #40311903 未加载
评论 #40315635 未加载