Hello Jason,
I'll try to be more detailed.
- There are N workers process generating data and adding it to a main queue
- A single process reads from the main queue and writes to postgres. The master server is hitting write capacity, because is unable to process queued data fast enough to keep the queue empty.
My question regard the ability to deploy a sharded AND replicated configuration, in order to gain in write speed and keep high availability.
I was thinking on a configuration like this:
Shard master (where the table is created with pg_shard, and also master)
/ \
Shard worker Shard worker (Each one implements a streaming replication, and is also a master of it)
/ \ / \
Slave Slave Slave Slave (Each data node keeps a full replica of its master, meaning that each has the exact copy of the partition of sharded table)
Is such configuration possible ?
If so, how would it be possible to read sharded tables from slave servers ?
Thank you