Real-Time Analytics for SaaS: Metrics, Churn, and Revenue
SaaS companies need real-time visibility into MRR, churn signals, feature usage, and customer health — not yesterday's batch report. A streaming database computes these metrics continuously from product events and billing data, enabling immediate response to churn signals and revenue changes.
| SaaS Metric | SQL Pattern | Business Impact |
| MRR | SUM(subscription_amount) | Revenue tracking |
| Churn signal | Usage drop + support tickets | Retention intervention |
| Feature adoption | COUNT(feature_events) per user | Product decisions |
| Customer health | Composite score from multiple signals | CSM prioritization |
| Trial conversion | Funnel analysis on trial events | Growth optimization |
Real-Time SaaS Metrics
-- Monthly Recurring Revenue (always current)
CREATE MATERIALIZED VIEW mrr AS
SELECT DATE(effective_date) as date,
SUM(amount) FILTER (WHERE type='new') as new_mrr,
SUM(amount) FILTER (WHERE type='expansion') as expansion_mrr,
SUM(amount) FILTER (WHERE type='churn') as churned_mrr,
SUM(amount) as net_mrr
FROM subscription_events GROUP BY DATE(effective_date);
-- Churn risk detection
CREATE MATERIALIZED VIEW churn_signals AS
SELECT customer_id, company_name,
MAX(last_login) as last_active,
NOW() - MAX(last_login) as days_inactive,
COUNT(support_tickets) FILTER (WHERE ts > NOW()-INTERVAL '7 days') as tickets_7d,
CASE WHEN NOW()-MAX(last_login) > INTERVAL '14 days' AND COUNT(support_tickets) > 2
THEN 'high' ELSE 'low' END as churn_risk
FROM customer_activity GROUP BY customer_id, company_name;
Frequently Asked Questions
Why do SaaS companies need real-time metrics?
Churn happens fast — a customer who stops logging in and opens support tickets is signaling departure. Batch reports detect this days later. Real-time streaming detects it immediately, enabling proactive retention.
Can RisingWave replace ChartMogul or Baremetrics?
RisingWave computes raw SaaS metrics from your billing and product data. ChartMogul/Baremetrics are purpose-built SaaS analytics products with dashboards and benchmarks. Use RisingWave when you need custom real-time metrics beyond what these tools provide.

