Live data from Hacker News

System design hack: Postgres is a great pub/sub and job server

layerci.com

161–162 of 162 posts

Re: System design hack: Postgres is a great pub/sub and job server

#161
post #99

I'll soon have to do a pub/sub for an application that's close to a multiplayer video game. Most advices I have seen say that I'll probably want to code it myself, but I was wondering about the latency of that solution? I'll likely have a SQL store and that would be a good argument to use postgres...

Perhaps checkout Nats, I'm very satisfied with it ( did pretty extensive research on finding a good message system)

It's similar to Apache Kafka but very light on resources and easy to selfhost.

Ow yeah, the throughput is around 150 k msg/s. Without much configuration.

Re: System design hack: Postgres is a great pub/sub and job server

#162
post #12
post #11

If you're working with Ruby I have had good experiences with Que[1], which implements a pattern similar to the OP using advisory locks. [1]: https://github.com/que-rb/que

Is there a similar library in Python? I really like the look of this approach, but don't want to build it myself if I can avoid it.

I just remembered that Celery has a DB backend too, but I've not looked deeply; I can't see it doing anything particularly fancy in the implementation:

https://github.com/celery/celery/blob/master/celery/backends...

Post reply on HN