Get the Replication/Lag time of Redshift

redshiftreplication

I'm currently running RedShift with pushes of all data from our production Postgresql databases every 10 minutes or so. Periodically, the ETL process from Postgresql to Redshift gets delayed or backed up. Is there any way to monitor the lag time between RedShift and Postgresql?

Best Answer

In this context, I usually create a specific table to see the last replication status.

On your PostgreSql master server, you create a simple table, example:

CREATE TABLE check_replication ( now_date timestamp );

Then you create a batch or job, that performs every minute, or more often:

INSERT INTO check_replication ( now_date ) VALUES (now());

Then, you add this table in the replicated tables from PostgreSql to RedShift

And you can check the replication delay.

HTH, Thomas