Earlier quoted context omitted.
This was actually for a few of my post-Google projects. At Google we would just use MapReduce regardless of how inappropriate it was because of the difficulty of standing up an RDBMS on Google's cloud infrastructure, plus CPU cycles were basically free for engineers. Maybe it's different now that internal projects are encouraged to use Google Cloud; Cloud SQL + Compute Engine works just fine for this. And this is def…
> CPU cycles were basically free for engineers. So what happened to a guy who had the bright idea to do CPU mining on Google's infra?
System design hack: Postgres is a great pub/sub and job server
141–150 of 162 posts
Re: System design hack: Postgres is a great pub/sub and job server
#142Re: System design hack: Postgres is a great pub/sub and job server
#143Another neat hack would be to use Postgres as a graph db
Re: System design hack: Postgres is a great pub/sub and job server
#144Another neat hack is to use Postgres as a quick & dirty replacement for Hadoop/MapReduce if you have a job that has big (100T+) input data but small (~1G) output data. A lot of common tasks fall into this category: generating aggregate statistics from large log files, searching Common Crawl for relevant webpages, identifying abusive users or transactions, etc. The architecture is to stick a list of your input shards…
Re: System design hack: Postgres is a great pub/sub and job server
#145Another neat hack is to use Postgres as a quick & dirty replacement for Hadoop/MapReduce if you have a job that has big (100T+) input data but small (~1G) output data. A lot of common tasks fall into this category: generating aggregate statistics from large log files, searching Common Crawl for relevant webpages, identifying abusive users or transactions, etc. The architecture is to stick a list of your input shards…
At the core of our implementation is this library to schedule the jobs to different workers: https://github.com/kagkarlsson/db-scheduler
Would highly recommend that library!
Re: System design hack: Postgres is a great pub/sub and job server
#146> It's rarely a mistake to start with Postgres and then switch out the most performance critical parts of your system when the time comes. This is pretty good advice in general.
Re: System design hack: Postgres is a great pub/sub and job server
#147And I'm more than perfectly fine with that.
Re: System design hack: Postgres is a great pub/sub and job server
#148Another neat hack is to use Postgres as a quick & dirty replacement for Hadoop/MapReduce if you have a job that has big (100T+) input data but small (~1G) output data. A lot of common tasks fall into this category: generating aggregate statistics from large log files, searching Common Crawl for relevant webpages, identifying abusive users or transactions, etc. The architecture is to stick a list of your input shards…
It reminds me of the taskmaster tool my team used at Google ( https://landing.google.com/sre/sre-book/chapters/data-proces... )
Re: System design hack: Postgres is a great pub/sub and job server
#149Another neat hack is to use Postgres as a quick & dirty replacement for Hadoop/MapReduce if you have a job that has big (100T+) input data but small (~1G) output data. A lot of common tasks fall into this category: generating aggregate statistics from large log files, searching Common Crawl for relevant webpages, identifying abusive users or transactions, etc. The architecture is to stick a list of your input shards…
Forgive my ignorance, how is this specific to postgres? Or what are the advantages of doing this in pg rather than mysql or redis?
Re: System design hack: Postgres is a great pub/sub and job server
#150Earlier quoted context omitted.
https://www.postgresql.org/docs/current/sql-notify.html > There is a queue that holds notifications that have been sent but not yet processed by all listening sessions. If this queue becomes full, transactions calling NOTIFY will fail at commit. The queue is quite large (8GB in a standard installation) and should be sufficiently sized for almost every use case. My understanding of MVCC (correct me if I'm wrong), is e…
Please notice the usual wisdom of PostgreSQL developers "(8GB in a standard installation)" meaning they probably set up a config parameter that you can tweak if you ever reach this limit while scaling. This is an often untold superpower of PostgreSQL when arguing about how it supposedly "don't scale well". You often have a large array of optimizations available before your project really scale out of scope.
My point isn’t that Postgres can’t do it. It can. But it just requires so much more effort to get it right. And this article glosses over so many critically important details about doing these things at scale in production environments. Most of them are things I don’t have to worry about when using a real queue service.