Reputation: 11
So a large part of my work involves a postgres system spread between many machines. The way we've been handling sharding is to create a separate postgres instance for each database shard. There are about ~10 shards per machine, each is bound to a distinct port, systemctl service, data root, config, etc.
These are large databases which have the potential to consume a lot of memory.
I inherited the sharding system from a previous developer, but I haven't thought to change it because it has been functioning so far. Is this a bad practice? Are there any potential side effects?
Upvotes: 1
Views: 1261
Reputation: 246403
It is fine to have multiple PostgreSQL instances on a single machine to be able to start, stop and upgrade databases independently.
However, it is strange to see a sharding solution where multiple shards are on a single machine. That seems like a waste of resources. But perhaps the idea is to move shards to other machines later, when load increases.
Upvotes: 2