Your product analytics pipeline may accept every event and still produce a misleading chart. I would look for a broken denominator before I looked for a throughput limit, because teams often change who qualifies for a metric without changing its name. For a junior developer, that is the dangerous scaling failure: the dashboard stays green while the question it answers quietly changes.
The first scaling failure is usually who gets counted
Imagine a feature that appears only after a user signs in, receives access, and opens a particular screen. In a hypothetical release, 1,200 users sign in, 300 qualify for the feature, 60 actually see it, and 12 use it. Those counts produce three different figures: 1% of signed-in users, 4% of eligible users, or 20% of exposed users. None is automatically wrong, but calling all three “adoption” makes a trend meaningless because each has a different denominator.
At small scale, the developer who built the screen can usually explain which users were counted. As more services and clients emit events, that explanation stops being shared knowledge. One client sends feature_exposed when an API returns access; another sends it after the screen renders. A background job marks a user eligible before the client has received the update. The chart can rise after a release simply because the event moved earlier in the journey.
I read What Breaks First as Backend Devs Scale Product Analytics as the broad question; my narrower answer is denominator drift, because it can corrupt a decision while ingestion latency and error rates remain normal. Write the population rule beside each metric: who can enter it, which event proves entry, which timestamp assigns a reporting day, and whether a person can enter more than once. An event name alone is too weak a contract because it says nothing about those decisions.
For the example above, define eligible_user as an authenticated user whose server-side access check returned true during the reporting window. Define exposed_user as an eligible user whose client confirmed that the feature rendered. Those are separate measures because a successful access check does not prove a visible impression. Record a stable feature key and a contract version on each event; otherwise, a renamed screen or revised access rule can silently combine unlike populations.
Do not treat a zero-count day as proof that nobody qualified, because a failed eligibility emitter produces the same number. Compare eligible users with the access-check records that created eligibility, and alert when the relationship changes unexpectedly. That check catches a semantic failure that a healthy HTTP response rate cannot see.
Retries turn an unclear event into a convincing lie
Once a client sends an event over HTTP, a timeout does not tell it whether the server stored the event. Retrying is reasonable, but generating a new event ID for the retry turns one action into two rows. HTTP 202 Accepted is not proof of durable storage either: it only says the request was accepted for processing. If a dashboard counts rows rather than distinct actions, ordinary network behavior can look like growth.
Generate an event ID when the action occurs, and reuse that ID on every retry. UUIDv7, specified in RFC 9562, is one way to create IDs that are practical to generate across clients; the deduplication rule matters more than the particular UUID version because the server must reject repeated IDs. This runnable Python example shows the storage invariant with SQLite’s sqlite3 library:
import sqlite3
db = sqlite3.connect(":memory:")
db.execute("CREATE TABLE events (event_id TEXT PRIMARY KEY, user_id TEXT, name TEXT)")
events = [("e1", "u1", "feature_exposed"),
("e1", "u1", "feature_exposed"),
("e2", "u2", "feature_exposed")]
for event in events:
db.execute("INSERT OR IGNORE INTO events VALUES (?, ?, ?)", event)
count = db.execute(
"SELECT COUNT(DISTINCT user_id) FROM events WHERE name = ?",
("feature_exposed",)
).fetchone()[0]
print(count)
The example prints 2, not 3, because the repeated e1 cannot create another row. In PostgreSQL, the equivalent production constraint is a unique index on event_id with INSERT … ON CONFLICT DO NOTHING. Keep the constraint in storage rather than relying only on application code, because concurrent retries can pass a check-before-insert test at the same time.
Deduplication does not settle identity. An anonymous visitor may sign in after an exposure, and joining both IDs retrospectively can make yesterday’s denominator change. Choose whether a metric uses the identity known at event time or a current merged identity, and record that choice with the query. I would not silently rewrite historical exposure counts after an account merge, because a chart that changes without a new event is difficult to audit. If the business needs merged-person reporting, publish it as a separately named measure.
Late events create a similar problem. A client may record an action offline and upload it the next day, so store both occurred_at and received_at. A tunable 24-hour lateness window gives yesterday’s chart time to settle; outside that window, issue an explicit correction rather than quietly changing a report people may already have used. The right window depends on your clients’ offline behavior, so measure that delay before treating 24 hours as a permanent rule.
PostgreSQL wins before Kafka when the contract is still moving
For an early product analytics pipeline, I would choose a PostgreSQL 16 event table or transactional outbox over a Kafka 3.8 topic, because a small team can inspect stored rows and enforce uniqueness without operating a separate streaming system. PostgreSQL wins when event volume fits the existing database budget, there are few consumers, and the event definition is still changing. Its cost is additional writes, index maintenance, storage, and eventual export work; running large analytical queries on the production primary can also compete with application traffic.
Kafka wins when several independent consumers need the same event stream, bursts exceed what the current write path can absorb, or replay is a deliberate operational requirement. Its cost is running brokers or paying for a managed service, monitoring lag, managing retention, and keeping consumers compatible as schemas change. Kafka does not repair a mistaken definition of “exposed,” because it delivers the mistaken event reliably.
PostgreSQL’s documented default max_connections is 100 for version 16, a vendor-published setting rather than a target for analytics traffic. That number is a reminder to check connection pooling and actual write load before adding an event write to every request. Use PgBouncer if connection churn is the bottleneck, and export to a reporting store such as ClickHouse when analytical scans begin to compete with transactional queries. Neither change should be made merely because a dashboard has grown popular; use measured database load and query latency to justify it.
I would not put a synchronous call to an external analytics service on the path that confirms a purchase or saves a document, because its outage would then become an application outage. If the analytics event must correspond to a committed database change, write an outbox row in the same transaction and deliver it afterward. Debezium can later stream committed changes if multiple consumers justify that complexity. If an event is only a client-side impression, send it asynchronously and accept that it needs its own delivery and deduplication checks.
I treat From zero to live product analytics without blowing the scope as a useful starting point, but I would block the first adoption dashboard until its denominator survives a retry and a delayed event. That is a smaller requirement than building a streaming platform, because it asks for a testable definition rather than more infrastructure.
A release should fail when a metric changes meaning unnoticed
Put event fields under a JSON Schema Draft 2020-12 contract, and require event_id, occurred_at, contract_version, and the fields needed to establish eligibility. Schema validation catches missing or mistyped fields, but it cannot prove that an exposure happened after rendering. For that, add a browser test with Playwright: grant access, wait for the feature to render, and assert that exactly one exposure is emitted; then deny access and assert that none is emitted. Those cases test the boundary that gives the denominator meaning.
Give the metric query its own test. In a dbt model or a plain SQL test fixture, insert an eligible user with no exposure, an exposed user with a duplicate event ID, and an anonymous user who later signs in. Assert the expected eligible and exposed counts separately. A worked fixture with 3 deliberately different users is more useful than a large random dataset here, because each row exercises a rule somebody could accidentally change.
Watch production for the failures the fixture cannot predict. Export counts of accepted events, rejected schemas, duplicate IDs, and events arriving beyond the lateness window to Prometheus; display their rates beside the adoption chart in Grafana. A flat adoption line accompanied by a spike in rejected schemas suggests a collection problem, not necessarily a product problem. Avoid labeling every rejection as “bad data,” because a new client version can expose an incompatible server contract.
Make metric changes visible in review. A pull request that alters eligibility, identity merging, or the exposure trigger should include the old and new SQL predicates plus a sample of users whose classification changes. If the definition truly changes, publish a new metric version or mark a break in the chart; retaining the old label implies comparability that the data no longer has. Keep user identifiers out of diagnostic logs where possible, because debugging a denominator does not require copying personal data into another retention system.
Your next step is one denominator test
Pick the adoption chart your team already checks. Write down the event that makes a user eligible, the event that proves exposure, and the identity rule used by its query. Then add one fixture containing an eligible user who never sees the feature. If that user disappears from the eligible count, fix the query before adding another emitter, broker, or dashboard.


