3 ms·
Re: why Postgres, two common answers: 1. For anyone whose stack is currently a simple three-tier architecture that currently has Postgres and nothing else in t
by derefr 5y ago
Re: why Postgres, two common answers:
1. For anyone whose stack is currently a simple three-tier architecture that currently has Postgres and nothing else in the DB tier, adding anything else would incur 100+% operational complexification (e.g. now you have to figure out how to do backups for two stateful components.) Far more than 100%, even, if they get the Postgres DB "for free" as part of a virtual LAMP-stack appliance, or built into the base offering of some PaaS service, and currently don't need to do any ops work as the framework/platform handles their DB's care and feeding for them. (Ideally, such setups would do the same with a built-in MQ as well — but sadly, that's much rarer.)
2. You can be clever with a job queue that’s in your DB, by making “taking the job” and “doing the queries that comprise the job” part of the same atomic transaction, such that a ROLLBACK due to a constraint validation error in "the queries that comprise the job" will also implicitly “put back” the job immediately (even if the worker crashed in response to seeing the error.)
- TameAntelope 5y agoGenerally yes, adding new tech can complicate your infrastructure, but specifically redis is one of those rare gems that, “just works”. If you use Celery, the time saved dropping Celery will more than cover the operational costs of redis. Really, one of the magic tools of the 21st century.