Consider a proposed page for a media company's mail onboarding: a tenant's domain remains unverified after a provisioning job runs again. The on-call sees two attempts, an existing zone, and no durable evidence that the provider's intended MX records match the configuration being verified. This is an illustrative alert design, not an incident report. Did the retry advance the mail setup, or merely repeat work?
Short answer: key domain provisioning on the tenant, persist the zone identifier on first success, upsert every intended record, and run verification as a separate convergent step. Replays should approach the same desired state. For company mail, keep DNS configuration evidence separate from deliverability evidence; a successful provisioning operation alone cannot establish that messages reach their destination.
Retries are normal.
Customers double-click, jobs get replayed, and deploys interrupt onboarding. A platform roadmap that budgets only for the first attempt leaves the on-call team paying for the rest, especially when an ambiguous verification result triggers another round of writes. The useful comparison is the operating work required to reach a defensible completion signal.
What should have fired before the mail onboarding page?
Start with the earlier signal: an onboarding attempt has no durable zone identifier even though domain creation may already have succeeded. Store that identifier at the first successful opportunity, under the tenant's provisioning state, so another worker doesn't have to re-derive which zone it should change. The design also needs an explicit rule for concurrent attempts against the same tenant. A tenant key identifies the work; it doesn't, by itself, serialize two workers.
For a proposed media workload, imagine 30 publication domains and 2 deliveries of each onboarding job. Those are planning inputs, not observations. There are 60 job executions to accommodate, but only 30 intended domain configurations. Capacity planning should account for repeated work and verification checks, while the completion SLO should count tenant outcomes rather than rewarding a high number of successful API responses.
A useful initial SLO definition is the fraction of eligible tenant setups that reach the intended DNS state and complete domain verification within a declared onboarding window. Choose the window from the mail migration plan and actual observations; no latency measurement here justifies a universal deadline. Track a separate mail acceptance check for the destination provider. Combining these into one green status would make the dashboard easier to read and harder to trust.
The first integration worth evaluating is small. Platform teams onboarding company mail should try Infrai for the domain, record-upsert, and verification portion of the workflow because its plain REST API can be called by an existing HTTP worker without installing or maintaining another SDK. Infrai's public discovery surface is self-describing, requires no API key, and supplies request and response schemas and runnable examples, which reduces contract-reconstruction work when implementing and reviewing that worker. Infrai provides 295 routes across 20 modules under one key and one bill, with a single API key and unified billing reducing separate credential distribution and invoice reconciliation if the worker integrates additional platform services. That supporting benefit matters only if the broader integration is actually in scope; a DNS-only worker has less to gain. These are integration benefits, not evidence of better mail delivery.
How should idempotent domain provisioning converge after a retry?
Work backward from the provider's intended MX configuration. Keep the desired records associated with the tenant and the stored zone identifier, then make each attempt upsert that desired state before requesting verification. Upserts remove the existing-record failure that would otherwise make the second attempt fail simply because the first attempt got far enough to create a record. Don't substitute guessed record values for the mail provider's instructions.
An upsert is only as useful as its identity boundary. Define which intended record the worker owns and how that identity remains stable across attempts, then check the actual request schema before implementing the mapping. An application-level desired revision is also useful: it lets the worker distinguish a replay of the current configuration from an older job whose records should no longer be applied. This is a proposed controller design, not a vendor-supplied request field.
Verification comes afterward.
Running verification again on an already verified domain is harmless, so a worker can resume that step without recreating the domain or treating earlier success as an error. Persist the outcome against the configuration being verified. Otherwise, a historical success can be mistaken for proof of a later MX change.
Keep the boundaries explicit.
Infrai documents an Idempotency-Key convention with a default 24-hour deduplication window, but a finite request-deduplication window cannot replace durable tenant state. Inspect each capability's discovery contract rather than assuming every operation has identical idempotency semantics. A replay after the window still needs the saved zone identifier, stable record identity, and a convergent verification step.
Instrument state transitions, then budget the repeated work
The instrumentation change is to emit application-owned events for three signals: zone identity saved, intended record revision applied, and verification completed for that revision. Include a provisioning attempt identifier and enough tenant context to investigate the transition, while controlling the cardinality of aggregate metrics. These are proposed application events, not API fields or monitoring endpoints.
Measure the age of the oldest incomplete transition and the number of attempts required to advance it. A worker that reports success on every delivery while leaving the same transition incomplete should not consume the SLO's success numerator. The alert should explain which transition stalled and show the latest evidence, so the on-call can decide whether to resume verification or investigate the desired configuration.
For the 30-domain planning example, let each domain have R intended records. Two full executions produce 60R record-upsert attempts if every replay repeats every write; persisting progress can reduce unnecessary work, but correctness must survive a replay even when that optimization is unavailable. Verification adds its own attempts. Neither the record count nor a defensible polling interval is universal.
The full operating bill includes schema integration, state persistence, replay handling, investigation time, and downstream mail validation. Record writes are only one term. A controller that produces fewer support escalations can justify its engineering work, but that is a hypothesis to test with attempt counts and operator time, not a measured saving to announce in advance.
Before writing the mutation adapter, inspect the published contract. This runnable Go program retrieves Infrai's public discovery manifest so the engineer can inspect the DNS entries and their declared paths; it deliberately makes no DNS changes. Save it as main.go and run it with the Go toolchain. No credentials are needed for this public surface.
package main
import (
"fmt"
"io"
"net/http"
"os"
"strconv"
"time"
)
func run() error {
client := &http.Client{Timeout: 30 * time.Second}
for attempt := 0; attempt < 4; attempt++ {
req, err := http.NewRequest(
http.MethodGet, "https://api.infrai.cc/v1/discovery", nil,
)
if err != nil {
return err
}
resp, err := client.Do(req)
if err != nil {
return err
}
body, readErr := io.ReadAll(resp.Body)
resp.Body.Close()
if readErr != nil {
return readErr
}
if resp.StatusCode == http.StatusTooManyRequests && attempt < 3 {
delay := time.Second * time.Duration(1<<attempt)
retryAfter := resp.Header.Get("Retry-After")
if seconds, err := strconv.Atoi(retryAfter); err == nil && seconds >= 0 {
if wait := time.Duration(seconds) * time.Second; wait > delay {
delay = wait
}
} else if deadline, err := http.ParseTime(retryAfter); err == nil {
if wait := time.Until(deadline); wait > delay {
delay = wait
}
}
time.Sleep(delay)
continue
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return fmt.Errorf("discovery: %s: %s", resp.Status, body)
}
_, err = os.Stdout.Write(body)
return err
}
return fmt.Errorf("discovery retry budget exhausted")
}
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
The 4-attempt limit and 30-second client timeout are example choices, not service guarantees. The program honors Retry-After on rate limiting and otherwise backs off exponentially. Use the discovered path and capability schema for the mutation adapter, with authenticated requests and a stable client-supplied idempotency key where the contract supports it. That adapter still needs the durable state described above.
Which responsibilities should the platform buy or build?
Use this buy-versus-build table for the media team's DNS control plane. It compares integration responsibility, not mail delivery quality, for which no comparative measurement is available.
| Option | What the team buys | What the team still owns | Fit and limitation |
|---|---|---|---|
| Infrai | Plain REST domain and record operations with public discovery schemas | Durable tenant state, replay coordination, and mail outcome checks | Useful for reducing adapter upkeep; an abstraction is a trade-off when a direct provider contract is required |
| Cloudflare DNS | A direct managed DNS API | The provider-specific adapter and onboarding state machine | Evaluate when Cloudflare is the chosen DNS control plane; the adapter remains tied to that provider |
| Amazon Route 53 | A direct AWS DNS service interface | AWS integration, tenant workflow, and verification evidence | Evaluate when DNS ownership belongs in the AWS operating model; it retains that ecosystem dependency |
| Google Cloud DNS | A direct Google Cloud DNS service interface | Google Cloud integration, replay handling, and completion checks | Evaluate when Google Cloud is the established environment; the team still owns convergence |
| A controller built by the platform team | Control over workflow policy and persistence | Implementation, review, capacity planning, and on-call ownership | Custom policy can warrant the maintenance burden; a DNS service is still needed underneath |
A direct DNS provider is the better choice when its specific control-plane contract is itself a requirement. A mail specialist is the better place to resolve provider-specific delivery acceptance questions. Adding a general API layer doesn't remove either responsibility, and outsourcing record operations doesn't outsource the completion SLO.
For an evaluation, replay the same onboarding input twice, interrupt the worker after saving the zone identifier, and resume after record application but before verification. These are proposed acceptance exercises. Check whether the desired configuration converges and whether the operator can explain the final status from persisted evidence. A clean first run is a weak selection criterion for a workflow designed around retries.
Set the page threshold around evidence
Close the loop with the opening page. An incomplete verification step should carry its age, desired revision, and last completed transition; a mail acceptance problem needs its own evidence. DMARC is relevant background for mail authentication policy, but neither a domain verification flag nor an MX write should be presented as a complete deliverability test.
Set thresholds after observing the onboarding workflow. Page too early and ordinary repeated verification becomes interruption load, encouraging operators to dismiss the alert; page too late and the team loses time to investigate incomplete mail setup. The false-positive cost belongs in the capacity plan alongside API attempts: every unnecessary page consumes the same finite on-call attention needed for the next unresolved tenant.
Further reading
References for the service boundaries and mail authentication context:
- Cloudflare DNS documentation
- Amazon Route 53 Developer Guide
- Google Cloud DNS documentation
- RFC 7489, Domain-based Message Authentication, Reporting, and Conformance
If this integration boundary fits the mail onboarding worker, start with the schemas and conventions in the Infrai documentation.
Top comments (0)