0

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.

2
  • Why doesn't your application target the requests at the read replica directly? Commented Jun 21, 2021 at 12:35
  • We are currently using Rails version 5 and it is not possible to do so. The support is available in next version but it will take time to upgrade. Commented Jun 21, 2021 at 12:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.