zlacker

[parent] [thread] 5 comments
1. des1nd+(OP)[view] [source] 2021-06-12 10:11:06
But I don't get it, why would you use PG for all these if specialized systems (and arguably optimized for that use case) already exist?
replies(5): >>cnorth+f >>konsch+B >>hardwa+Z >>jpalom+b2 >>Gordon+Ju2
2. cnorth+f[view] [source] 2021-06-12 10:13:04
>>des1nd+(OP)
Operational ease
3. konsch+B[view] [source] 2021-06-12 10:16:27
>>des1nd+(OP)
Because you already have a Postgres DB running probably and you know how to back it up, you know how to upgrade it, all your services can already authenticate towards it, your developers can run it locally, you know how to mock it…
4. hardwa+Z[view] [source] 2021-06-12 10:19:38
>>des1nd+(OP)
Just repeating what others have said:

- Postgres is probably already running (it's pretty good for OLTP workloads)

- Operational ease and robustness

- Cloud support everywhere for Postgres

- People know how to backup and restore postgres

- Sometimes Postgres will beat or wholly subsume your specialized system and be a good choice

- Postgres has ACID compliance and a very good production-ready grasp on the research level problems involved in transactions. I've never met an etcd/zookeeper cluster I didn't wish was simply a postgres table. Image being able to actually change your cache and your data at the same time and ensure that both changes happen or none of them happen (this is a bit vaporware-y, because locks and access pattern discrepancies and stuff but bear with me). You're much more unlikely to see Postgres fail a Jepsen test[0]

[0]: https://jepsen.io

5. jpalom+b2[view] [source] 2021-06-12 10:33:27
>>des1nd+(OP)
One practical thing is that consistent backups can become very difficult if you distribute your state to multiple places.
6. Gordon+Ju2[view] [source] 2021-06-13 14:23:57
>>des1nd+(OP)
I wouldn't personally use Postgres for all of these, but have done so successfully multiple times for a decent subset:

- storing relational data (duh)

- storing JSON documents with Postgres' JSONB support - it really is very good, and being able to query relational and document data in the same query is wonderful

- storing key/value type data, where I only need to store a small amount of such data - seems silly to spin up Redis for such a small requirement

- time-series data - TimescaleDB is amazing. Performance may not be on par with a highly tuned schema with a purpose-built time series database, but it's still very, very good. It's fast even with billions of rows, has data compression, and it's really nice to be able to be able to query it just like any other Postgres tables. And the TimescaleDB folks are really helpful on Slack and GitHub. I'm a huge fan of TimescaleDB, and think it's more than adequate for a lot of time-series use cases

- full text search - Postgres shines here too! It's not as powerful as the likes of Elasticsearch, but it's still very good, and very fast. And Elasticsearch is not trivial or cheap to setup and maintain

For queues and pub/sub, RabbitMQ is my go-to solution.

[go to top]