Skip to main content

Notification Statistics Persistence

Summary

There is no statistics table. Notification statistics are computed on demand by counting rows, with no materialised aggregate, rollup, snapshot or counter column anywhere in the schema.

Audience

Engineers, architects, QA, support and DevOps engineers.

Verified absence

The context maps seven entities and none of them is an aggregate, summary, rollup or counter table. No reviewed code path maintains a running total, increments a stored counter, or writes a periodic snapshot.

How statistics are produced

The statistics endpoint issues eight separate count queries in a single handler and projects the results into one anonymous response:

CountSource tablePredicate
Templatestemplatesnone
Recipientsrecipientsnone
Messagesmessagesnone
Sentmessagesstatus is sent
Failedmessagesstatus is failed
Readmessagesstatus is read
Processed eventsidempotency ledgernone
Delivery attemptsattemptsnone

Cost characteristics

Every call performs eight aggregate scans across four tables, none of them tenant-filtered and none of them time-bounded. The three status counts filter on a status column that no index leads with. Cost therefore grows linearly with total stored volume, and because nothing is ever deleted, that volume only increases.

Scope

The counts are platform-wide. No tenant, channel, date or event-type dimension is applied or accepted, so the result cannot be attributed to a tenant.

Classification

Foundation — a working aggregate read exists; no statistics persistence exists.

Requires confirmation

Whether materialised statistics, tenant dimensions or time windows are planned requires confirmation.

See Also

Keywords

  • Notification database
  • Statistics Storage
  • Draft database documentation

Source References

  • microservices/src/notification-service/Api/NotificationEndpoints.cs
  • microservices/src/notification-service/Infrastructure/NotificationDbContext.cs
  • microservices/src/notification-service/Domain/NotificationEntities.cs

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-21
  • Review cycle: Quarterly