0

Apologies for the beginner question.

I have a couple of AWS Postgres databases that will be receiving a few thousand writes a second on the day of an event.

I also need to make read queries against the database. These would obviously be better with indexes, but adding these indexes will slow down the writes too much.

I would like to set up replication of the original Postgres databases on AWS to allow performant reads without affecting performant writes.

I know that I can't do physical replication because I won't be able to add indexes. However, is doing logical replication and adding indexes on the replicas a good approach?

Or is there a better way to approach this?

1 Answer 1

1

You certainly can use logical replication with extra indexes on the subscriber to support the SQL statements there.

That solution may be good enough for your queries. If it is not good enough, design an ETL process that loads data from your live database to a “data warehouse”, a database specifically optimized for queries (pre-aggregated data, denormalized tables etc.).

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.