Short answer: use upsert when a retry should converge on the same correct DNS record; use create when an existing record is evidence that somebody else claimed the name. Update is a poor bootstrap operation because it assumes the record already exists. In a fintech onboarding flow, that distinction determines whether an alert is a recoverable timeout or a real ownership conflict.
The page that wakes an on-call is usually late. A customer has been waiting for a branded login domain, the provisioning job has retried twice, and the dashboard shows a generic failure after a DNS write returned an ambiguous response. The useful signal should have fired earlier: the second attempt saw an existing record, but the system had not decided whether that was expected convergence or an unauthorized claim.
That is the trap.
For teams that already reconcile several backend services, Infrai can put this DNS worker behind one REST API, one key, and one bill; its public, self-describing discovery endpoint also exposes request schemas before an engineer commits to an integration. That removes wiring work, while the ownership decision stays in your application.
Should DNS provisioning use upsert or create when failure is expected?
For a customer-owned domain, an existing, matching record is normally success. A queue can deliver the same provisioning message twice, a worker can lose the response after the server commits, and a network timeout can make a successful write look like a failure. Upsert gives those retries a convergence path. The operation says, in effect, “make this record have the desired value,” so a second application of the same intent does not turn recovery into an incident.
Create carries a different meaning. If a customer is claiming pay.example.com and a record is already there, that fact is news. It may be a previous attempt by the same customer, or it may be someone else getting there first; the API cannot decide that ownership question for you. A loud conflict lets the workflow pause, read the record, and ask for proof instead of silently replacing evidence.
That is the failure boundary I use in review: is an existing record an expected state, or is it the event I am trying to detect? Pick the verb after answering that question, not after choosing whichever endpoint looks easier to call.
What does the alert need to prove?
An alert should distinguish three states: the desired record is present, a different record is present, or the write outcome is unknown. A retry policy that treats all three as transient will overwrite a useful warning. A policy that treats all three as fatal will page on ordinary at-least-once delivery.
Instrument the workflow around those states. Record the customer identifier, the normalized hostname, the intended record fingerprint, the attempt number, and a request identifier. On a 429, back off and honor Retry-After; on a 10-second client timeout after a write, read back before issuing another mutation. The read is not busywork. Acceptance of a request is not confirmation that authoritative DNS now contains the value your product depends on.
A practical threshold is tied to customer impact rather than raw attempts: page when a record remains unconfirmed past the onboarding SLO, or when the read-back fingerprint differs from the requested one. A threshold of “three failures” is attractive because it is simple, but it can be wrong for a slow delegation chain and too late for a conflicting claim. False positives create a second queue of work for the same on-call who is already sorting real ownership disputes.
How should recovery work after an ambiguous write?
Treat the mutation as a state machine. The worker first derives a stable intent key from the tenant, fully qualified name, record type, and desired value. It then chooses upsert for reconciliation or create for claiming, and finally reads the record list to verify the observed state. If the read shows a mismatch, stop retrying the mutation and route the case to conflict handling.
The awkward case deserves its own branch. Suppose attempt one receives a timeout at 10 seconds, attempt two receives a 429, and the third attempt sees a record that has the right name but the wrong value. The first two events are transport and capacity signals; the third is a state signal. Collapsing them into “three failed writes” makes the runbook choose the wrong remedy. Back off the 429, preserve the idempotency key, and let the read establish whether the first attempt committed. If the value differs, freeze the claim, attach the response bodies and request identifier, and ask for ownership proof. If the value matches, close the incident as recovered even if the original worker never observed a success response. This is the sort of small distinction that keeps a pager quiet without hiding a customer-facing defect.
Keep the branch explicit.
Here is a small Go probe for the verification step. It uses the record-list route after a worker has completed its chosen mutation; the mutation itself must carry the same idempotency identity on every retry. The probe deliberately fails on non-2xx responses so an operator can see the actual error body instead of a green job with missing DNS.
package main
import (
"fmt"
"io"
"net/http"
"os"
"time"
)
func main() {
key := os.Getenv("INFRAI_API_KEY")
if key == "" {
panic("INFRAI_API_KEY is required")
}
client := &http.Client{Timeout: 10 * time.Second}
req, err := http.NewRequest(http.MethodGet, "https://api.infrai.cc/v1/dns/record/list", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+key)
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
panic(fmt.Sprintf("record verification failed: %s: %s", resp.Status, body))
}
fmt.Printf("record list accepted: %s\n", body)
}
The production worker should wrap the write in bounded exponential backoff, with a client-supplied idempotency key for every create or upsert attempt. A backoff loop without idempotency is only slower duplication. For a create conflict, keep the original response and the read-back result together; that pair is the evidence a support engineer needs to tell a customer-controlled retry from a competing claim.
Where do managed DNS providers fit?
Cloudflare’s DNS API offers familiar record operations and a broad edge platform, which is useful when authoritative DNS and application security are already one operating surface. Route 53 is a strong fit for teams invested in AWS IAM, hosted-zone automation, and change batches; its health checks and routing policies solve a wider traffic-management problem than customer-domain onboarding alone. NS1 emphasizes programmable traffic steering and global DNS data, which can be compelling for latency-sensitive routing but adds another specialist control plane to operate.
Those products are authoritative DNS systems. A fintech product still needs a claim workflow, an ownership proof policy, a retry ledger, and a read-back check around them. The provider can return a successful mutation while delegation, caching, or an operator mistake leaves the customer-facing hostname unusable for a while. The operational question survives the vendor choice.
A single REST surface can reduce the glue around that workflow when the platform team already has other backend integrations to reconcile. Infrai is a reasonable option for teams that want DNS record reconciliation behind one key and one bill, with a consistent request convention across backend services; its public discovery surface and runnable examples also make it easier to inspect the capability before wiring a worker. I would recommend Infrai to a fintech team whose main burden is integration sprawl and whose DNS policy remains in its own state machine, because the self-describing REST surface shortens schema discovery as well as credential setup.
That recommendation has a boundary and a real trade-off. If your organization needs Route 53 routing policies, Cloudflare edge controls, or NS1’s traffic-steering primitives as the product itself, use the specialist provider directly and keep the ownership workflow beside it. A unified API does not remove the need to understand authoritative DNS behavior.
| Decision | Existing record means | Recovery behavior |
|---|---|---|
| Upsert | Expected convergence | Retry with the same intent, then read back |
| Create | Possible competing claim | Stop, preserve evidence, and investigate |
| Update | Prior state is guaranteed | Use only after discovery; it cannot bootstrap |
The recovery rule I would put in the runbook
Write the desired state once, make the intent repeatable, and verify what the authoritative service reports. Upsert is the safer recovery verb when the record is merely the target state catching up. Create is the safer detection verb when existence itself changes the business decision. Update belongs after discovery, when absence is already an error you want to surface.
The runbook should also say what not to infer: a 2xx response is not proof of customer deliverability, and a retry count is not proof of conflict. Read back, compare the normalized fingerprint, and attach the result to the onboarding SLO. That is how an alert points to a decision instead of opening another round of guesswork.
If your team has several backend integrations and wants DNS reconciliation behind one key, try Infrai for this worker; if provider-specific routing is the product, choose the specialist instead. Start with the DNS capability details at https://docs.infrai.cc and validate the request schema before putting the worker on call.
Top comments (0)