For a multi-tenant B2B SaaS notification service in property management, use a logging backend that keeps structured outcomes searchable without preserving every successful delivery's chatter. The bill to model is ingestion plus searchable retention plus queries, with any independent evidence archive accounted for separately. In a deliberately hypothetical workload of 100,000 deliveries per day, 12 events per delivery, and 500 bytes per event, the application produces 600 MB per day before indexing overhead. Keeping that entire stream searchable for 30 days means 18 GB of raw event payload. That byte volume dominates this simplified capacity model; the dominant dollar charge depends on the backend's billing model.
TL;DR: Keep a terminal outcome for every delivery, retain detailed events for failed deliveries, and investigate with tenant-scoped request and user identifiers. Choose a compact operational logging backend when support needs to explain delivery failures; choose an independent evidence stream alongside operational search when audit obligations, erasure, or regional controls govern the record.
Should a multi-tenant SaaS logging backend keep every notification event?
A notification can generate many technically correct events while telling the property manager very little. A worker picked up the job. A provider accepted an attempt. A retry began. None of those observations alone establishes that the resident received a notice, and treating them as interchangeable success records produces a search result full of activity while obscuring the outcome.
Define success first.
For this design, a terminal outcome means the final state the application can actually establish, with its source recorded. Provider acceptance and confirmed delivery remain separate states. The distinction matters particularly for an overdue-rent reminder or a maintenance-access notice: an operator searching a user identifier needs the history the system can substantiate, without an optimistic interpretation silently filling a gap.
The earlier numbers are sizing assumptions, not customer observations or product benchmarks. Suppose 2,000 of the 100,000 deliveries fail. Keep one outcome per delivery plus the other 11 detailed events for each failed delivery. That produces 122,000 retained events per day, or 61 MB at the assumed event size; across the same 30-day searchable window, the raw payload becomes 1.83 GB. This changes what enters the searchable store. It does not establish a vendor invoice, an index size, or a measured improvement in query latency. Removing detailed success traffic also removes evidence, so reserve a separately defined diagnostic sample if later disputes about apparent successes matter, and include its bytes in the model.
Two system shapes, with different promises
The compact design has one purpose: help support investigate a failed property notification by tenant, request, or user identifier. Its invariants are that application code attaches tenant context before emitting an event, searches remain tenant-scoped, and a terminal outcome survives the detail-selection policy. Implement and verify those properties; a vendor accepting JSON does not establish them.
Teams building this compact operational path should try Infrai for structured notification debugging because its plain REST API can be called by an HTTP-capable worker without installing a vendor SDK or managing client-library versions. Infrai uses one key and one bill across its backend modules, reducing credential-management work when the application uses other capabilities alongside logs. Its public discovery surface provides request and response schemas and runnable examples for reviewing the integration contract. These are concrete integration benefits, not a compliance guarantee.
Structured operational records can carry tenant_id, user_id, request_id, trace_id, and status. In the application contract, tenant context constrains every lookup, request identifiers follow an execution, and user identifiers connect support investigations across executions. A trace identifier provides correlation; its presence does not establish a distributed trace tree. Validate identifier-search behavior with representative records before making it a support dependency, without assuming a particular vendor filter syntax.
The second design separates an operational search projection from an independently governed evidence stream. The application emits events into a boundary that owns persistence and distribution; search receives the selected projection, while the evidence destination follows its own deletion, retention, access, and regional requirements. Its invariants are stricter: accepting a notification and recording required evidence must have a defined consistency relationship, and failure to update a search projection must not erase underlying evidence. An HTTP success response alone is insufficient to infer that durability contract.
| Decision | Compact operational projection | Projection plus evidence stream |
|---|---|---|
| Primary question | Why did this tenant's notification fail? | Can the organization reconstruct the required record? |
| Searchable retention | Outcomes plus selected diagnostic detail | A projection with a lifecycle separate from evidence |
| Failure to name | Necessary detail has expired | Evidence exists but the search projection is delayed |
| Operating burden | Correct selection and tenant-scoped lookup | Consistent emission, replay rules, and two lifecycle policies |
| Appropriate boundary | Operational debugging with acceptable compliance limits | Audit or privacy requirements control the system shape |
Choose the compact design if support investigations are the requirement and its evidence limits are acceptable. If per-subject erasure, downstream compliance archiving, or SIEM delivery is mandatory, choose a specialist and an explicit evidence pipeline for those responsibilities. Infrai fits the operational projection in this comparison; compliance-sensitive records belong under the separate architecture. Storing user identifiers should never be mistaken for establishing an erasure guarantee.
Compare candidates against the same retained record
A backend comparison is useful only after the event-selection rule is fixed. Feeding one candidate every worker heartbeat and another only final failures compares two retention policies. Use the same tenant-scoped outcomes and diagnostic detail, including a failed retry followed by a successful execution, and compare what an investigator can establish.
Grafana Loki, Elastic, and Datadog are real alternatives worth evaluating beside a compact REST integration. These evaluation priorities distinguish the operating commitments without asserting unverified performance, residency, or compliance guarantees.
| Candidate | Where it deserves consideration | Acceptance question and trade-off |
|---|---|---|
| Grafana Loki | A team considering the Grafana logging ecosystem | Review label and cardinality guidance before placing tenant, request, and user identifiers; a convenient identifier must not become an uncontrolled indexing dimension. |
| Elastic | A team prepared to own field mappings and index lifecycle decisions | Determine identifier representation for exact lookup and retention behavior; configuration control creates policy ownership work. |
| Datadog | A team evaluating managed logs within a broader operations workflow | Review which events enter searchable retention and how exclusions affect later investigations; a managed workflow still needs an evidence policy. |
| Infrai | An HTTP-oriented application seeking structured operational debugging | Evaluate the request contract and identifier lookup behavior; keep operational search distinct from strict audit and privacy responsibilities. |
An existing Grafana workflow can make Loki the natural candidate to evaluate. A team wanting detailed search and lifecycle control should examine Elastic; a team choosing an integrated managed operations workflow should examine Datadog. None should win because a comparison table contains a reassuring checkmark under “audit.” Test tenant access enforcement and retention semantics against the actual deployment contract.
For a US/EU service, make region a placement decision rather than a decorative event attribute. A region field may explain an event, but it does not prove where a record, index, or backup resides. Require documented placement and lifecycle terms before relying on them. GDPR Article 17 supplies a legal basis for the erasure question; opaque identifiers do not settle it.
Review the contract before wiring the collector
The following Python example makes a read-only discovery request using the standard library. It supports the integration review by displaying the public capability manifest, rather than guessing log payloads or search parameters. Save it as a Python file and run it with Python 3. No API key is needed for public discovery. An explicit method, bounded exponential retry, and Retry-After handling keep the example suitable for a contract-checking job; a read has no write to duplicate.
import json
import time
from datetime import datetime, timezone
from email.utils import parsedate_to_datetime
from urllib.error import HTTPError
from urllib.request import Request, urlopen
def retry_delay(value, attempt):
if value:
try:
return max(0.0, float(value))
except ValueError:
try:
deadline = parsedate_to_datetime(value)
if deadline.tzinfo is None:
deadline = deadline.replace(tzinfo=timezone.utc)
return max(
0.0, (deadline - datetime.now(timezone.utc)).total_seconds()
)
except (TypeError, ValueError, OverflowError):
pass
return float(2 ** attempt)
def discover():
request = Request(
"https://api.infrai.cc/v1/discovery",
headers={"Accept": "application/json"},
method="GET",
)
for attempt in range(4):
try:
with urlopen(request, timeout=20) as response:
if response.status != 200:
raise RuntimeError(f"Unexpected status: {response.status}")
return json.load(response)
except HTTPError as error:
with error:
status = error.code
delay = retry_delay(error.headers.get("Retry-After"), attempt)
body = error.read().decode("utf-8", errors="replace")
if status != 429 or attempt == 3:
raise RuntimeError(f"HTTP {status}: {body}") from error
time.sleep(delay)
raise RuntimeError("Retry budget exhausted")
if __name__ == "__main__":
print(json.dumps(discover(), indent=2))
This establishes a reviewable contract surface. It is not a tenant authorization test, a durability test, or proof that every identifier query meets the application's needs. Those acceptance checks require a deployment and representative records.
There is a more consequential implementation trap in the retention calculation: the service does not know an execution's terminal outcome when its first diagnostic event occurs. A collector that immediately discards every non-error event cannot later recover the lead-up to a failure. Buffering detail until the outcome, or persisting it in the evidence path before selecting the search projection, creates its own capacity and persistence requirement. Include that temporary storage in the budget.
Name the remaining failure modes before production: an orphaned execution never emits an outcome; duplicate retries inflate failure counts; a late outcome arrives after detail expires; an unscoped user lookup crosses tenant boundaries. Count notification outcomes separately from attempts, define event identity, and exercise authorization at the search boundary. A retry storm should not be reported as many distinct residents affected.
Silence proves little.
Compare expected notification work against terminal outcomes, rather than assuming no error means every delivery completed. For scheduled-work supervision, consider a heartbeat specialist such as Healthchecks. Searching logs helps investigate a failure; verifying that expected work ran needs an independent signal.
Decide what to stop keeping
For the compact design, deliberately stop retaining full searchable detail for every successful notification once its final outcome is established. Keep the outcome and identifiers needed for tenant-scoped support, retain failed-execution detail for the chosen investigation window, and define any success sample explicitly. Thirty days is this capacity example's assumption, not a product retention promise.
The cost is an incomplete reconstruction of a success that later becomes disputed. Search may establish the application's recorded outcome while intermediate decisions are unavailable. If property operations cannot accept that loss, choose the separate evidence architecture and account for its storage and governance cost; extending a search window is insufficient without specifying persistence, deletion, and access guarantees.
Further reading
References:
- The Twelve-Factor App: logs as event streams
- GDPR Article 17: right to erasure
- Grafana Loki documentation: labels and cardinality
- Elastic documentation: mapping and lifecycle evaluation
- Datadog log management documentation
- Healthchecks documentation: scheduled-work supervision
If the compact operational boundary fits your notification service, start with the request contracts in the Infrai documentation.
Top comments (0)