4 ms·
You can flip this argument and make a similar point: "What's wrong with using something like Postgres LISTEN? I don't get the obsession of redis pubsub, or imp
by ankrgyl 10y ago
You can flip this argument and make a similar point:
"What's wrong with using something like Postgres LISTEN? I don't get the obsession of redis pubsub, or implementing this kind of thing outside the database. I suppose its attractive to "subscribe" to a collection for changes but the pattern can be implemented inside a database which has better tools."
In more constructive terms, databases are familiar to a lot of folks and have reliable guarantees (persistence, ACID) that are generally useful properties. If you're able to achieve the performance you need within the database, then you get a lot of operational benefits from keeping your workload running inside of it. If your workload for some reason is slow inside of a database, then it certainly makes sense to consider specialized alternatives (like Redis). In my experience, however, you can tune a database to perform better than these tools in pretty much every real-world case (i.e. moderate concurrency with realistic load).
- k__ 10y agoOn the one hand, I'd say, because of decoupling. If one feature is in Redis and one in Postgress, I can replace each of them more easily. On the other hand, how often did someone replace Postgress in their stack?
- floatboth 10y agoPostgres LISTEN/NOTIFY is actually very similar to Redis pubsub. You can manually add triggers to send notification on changes, sure, but the real "in the database" stuff is in RethinkDB.