Solution blueprint · not a client project
Multi-Tenant SaaS Analytics Dashboard
How we build customer-facing analytics into a SaaS product: tenant-isolated data, fast aggregates, role-based access and dashboards customers can configure themselves instead of emailing support for exports.
The problem
Customers want to see their own numbers inside the product. Today they request CSV exports from support, the engineering team writes one-off SQL, and queries on the production database slow the app down for everyone.
Our approach
A separate analytics pipeline into a columnar store, strict per-tenant isolation, a small library of well-defined metrics, and embeddable dashboards with filters, drill-downs, scheduled reports and exports.
What success is measured by
Dashboard query latency at the 95th percentile, share of active accounts using analytics weekly, support tickets tagged as data or export requests, and whether analytics usage correlates with retention or plan upgrades.
Who this blueprint is for
B2B SaaS companies whose customers ask "how is this performing for us?" — fleet, HR, field-service, education, e-commerce and marketing platforms are typical. Usually the product already stores the raw events; the gap is turning them into trustworthy numbers each customer can see without help.
The usual starting point
Analytics starts as a few charts querying the production database, then grows into a backlog of export requests. Three problems follow: heavy queries compete with the transactional workload, metric definitions drift (two screens show different "active users"), and every new report needs an engineer.
Architecture
Separate the analytical workload. Events and relevant tables are replicated from the production PostgreSQL database into ClickHouse, a columnar database designed for fast aggregation over large volumes. The app's own database stops carrying reporting load.
Model metrics once. Transformations live in dbt: each metric has one definition, documented and tested ("active user = at least one qualifying action in the period"). Dashboards read from these models, never from ad-hoc SQL, so the same number shows the same value everywhere.
Tenant isolation as a hard rule. Every analytical row carries a tenant identifier, every query is scoped by the server from the authenticated session — never from a parameter the browser can change — and in PostgreSQL we use row-level security as a second layer. Cross-tenant leakage is the one bug a SaaS analytics feature cannot survive, so it gets automated tests of its own.
Dashboards customers can shape. A curated set of charts (Apache ECharts) with date ranges, filters, comparisons to previous periods and drill-down to the underlying records. Customers can save views, schedule a PDF or CSV by email, and admins can restrict which roles see financial metrics.
Pre-aggregation for speed. Common rollups (daily, weekly, per entity) are materialised so dashboards stay fast as data grows; raw data stays available for drill-down.
Delivery plan
- Metric inventory. List every number customers ask for, agree definitions with product and sales, and drop the ones nobody can define.
- Pipeline and models. Replication into ClickHouse, dbt models with tests, and backfill of history.
- First dashboard. One high-value dashboard to a small group of customers, measured for usage and questions.
- Self-serve features. Saved views, scheduled reports, exports, role controls.
- Embedding and APIs. Optional metrics API or embedded dashboards for customers who want the data in their own BI tools.
Risks and how we handle them
- Numbers customers dispute. Metric definitions are shown in the UI next to each chart, and dbt tests catch broken source data before customers do.
- Data freshness expectations. We agree a freshness target per metric (near-real-time vs. hourly vs. daily) instead of promising "live" everywhere.
- Cost growth. Retention policies for raw events and rollups keep storage predictable.
- Personal data. Analytics rarely needs names or phone numbers; we aggregate or pseudonymise where possible, consistent with purpose limitation under the DPDP Act, 2023.
What success is measured by
95th-percentile dashboard load time, the share of active accounts opening analytics each week, data/export support tickets before and after launch, and — over a longer period — whether accounts using analytics renew or upgrade at different rates. We set up the measurement; we do not assume the outcome.
When this is not the right approach
If only internal staff need reports, a BI tool such as Metabase or Power BI on a read replica is cheaper and faster to deliver. Building in-product analytics is worth it when the analytics is part of what customers pay for.
This is a solution blueprint: it describes how Splicity Dynamics approaches this kind of system — architecture, delivery plan, risks and measurement. It is not a description of a specific client engagement, and it makes no claim about results achieved for a client.

