Data Layer medium complexity backend
0
Dependencies
1
Dependents
0
Entities
0
Integrations

Description

Manages the lifecycle of PostgreSQL materialized views used for aggregate reporting across the organization hierarchy. Triggers nightly REFRESH MATERIALIZED VIEW CONCURRENTLY operations and records refresh timestamps for staleness detection.

Feature: Multi-Organization Hierarchy

materialized-view-refresher

Responsibilities

  • Schedule and execute nightly materialized view refreshes
  • Support on-demand manual refresh triggered by admin action
  • Track last-refresh timestamps and expose staleness status
  • Handle concurrent refresh to avoid blocking live read queries

Interfaces

scheduleNightlyRefresh(): void
triggerManualRefresh(viewName?): Promise<void>
getLastRefreshTime(viewName): Date
isStale(viewName, thresholdHours): boolean
listManagedViews(): string[]

Relationships

Dependents (1)

Components that depend on this component