We are using PostgreSQL version 13 and our database has a high volume of read request about 95% and 5% write request. We have a read only replica in slave mode as well. So to offload my primary server I want to derive a strategy where I can redirect reads on slave server or maybe some other master-replica server and writes on the primary server. To achieve this I found that this can be achieved using PostgreSQL foreign data wrapper. To test my idea I created the remote server and I was able to access the data on remote server.
So I was looking if I can devise a solution where I can redirect my read requests on slave database using foreign data wrapper and more precisely if this is a wise solution since foreign data wrapper will access data from other database and requests can get slow.
Any help in this regard is highly appreciated.