Product Benefits Pricing Guides Docs About Contact us Try it out
Analytics tools

PostHog Postgres CDC Sync Tracking

PostHog Postgres CDC tracking: measure sync lag, row counts and data freshness so app analytics and backend records always agree.

· 3 min read

Your analytics tool knows what users tapped. Your database knows what they bought, cancelled or were refunded. When the two disagree, nobody trusts the dashboard. Without tracking how fresh the synced data is, a plan upgrade can show in your product database for hours before it shows in your funnel, and you will blame the funnel.

On 12 November 2026, PostHog made Postgres change data capture (CDC) generally available in its data warehouse. Instead of re-reading whole tables on a schedule, CDC reads the database change log and syncs only what changed. It is no longer behind a feature flag for eligible tables.

That is good news, but a faster pipe still needs measuring. A silent stall looks exactly like “no one upgraded today”.

Data Points to Track

Log these as events from a small monitoring job, or record them in your own tracking plan:

  • table_name: which synced table the reading relates to, such as subscriptions or orders.
  • sync_mode: cdc or full_refresh, so you can compare the two.
  • rows_synced: count of changed rows in the last run.
  • sync_lag_seconds: time between the database commit and the row being queryable.
  • sync_status: succeeded, interrupted or failed.
  • source_row_count and warehouse_row_count: for a simple reconciliation check.
  • app_version: to spot app releases that change write volume.
  • joined_metric: the product metric that depends on the table, such as paid_conversion.

Setup Steps

  1. List the backend tables your product metrics depend on: subscriptions, orders, accounts and entitlements are the usual ones.
  2. Enable CDC for those tables in the source settings, and keep a full refresh as a fallback for tables CDC cannot cover.
  3. Add a updated_at column to each table if it is missing, so lag can be calculated.
  4. Run a scheduled query that compares the newest updated_at in your database with the newest one in the warehouse, and store the gap as sync_lag_seconds.
  5. Compare row counts daily and record any difference as a reconciliation_gap event.
  6. Alert when lag passes a threshold you choose, for example 15 minutes for billing tables.
  7. Annotate dashboards with the date you switched each table to CDC so before-and-after charts are read correctly.

Actionable Insights

Lag against revenue. If lag rises while revenue charts flatten, the sync is the problem, not demand. Check status before you change pricing.

Interrupted syncs. A run that stops half way can leave person properties out of date. Track how often runs are interrupted and how long recovery takes.

Row gaps. A steady difference between source and warehouse counts points to deletes or filters you did not expect. Fix it once and the gap should drop to zero.

Cost and volume. CDC changes how much data moves. Compare rows synced per day before and after the switch to confirm it is cheaper, not just newer.

Funnel trust. Once lag is visible, product managers stop asking whether a dashboard is “right” and start reading it.

Common Mistakes to Avoid

Teams often switch a table to CDC and then stop watching it. Set an owner for each synced table, and review the lag chart in your weekly product meeting for the first month. Do not join a freshly synced table to events without checking its lag first, because a gap of an hour can make a conversion rate look lower than it really is. Finally, keep schema changes in mind: when a column is renamed or dropped in the source database, the sync may pause or drop data, so add a schema_change annotation whenever your backend team ships a migration.