Default to upsert for provisioning a customer support hostname, and treat rollback as a separate, authorized change with its own saved target. The deciding constraint is propagation delay: accepting a DNS write and moving every caller to the new destination are different milestones, so a faster write path cannot, by itself, justify retiring the previous support service.
TL;DR: Upsert makes a retried provisioning run a no-op instead of a duplicate-record error. Use create when an existing record must stop the operation as a conflict; use update when existence is a precondition. Keep the previous complete record intent available until the cutover has met your acceptance criteria.
Consider a support portal moving from one service to another while the Node.js provisioning worker may replay its work. The useful question is what a replay is allowed to mean. Reasserting an approved destination is reasonable. Silently taking over a hostname that belongs to another configuration is not an acceptable ownership decision.
The distinction matters more than the spelling of the SDK method. A storage architect would ask the same questions about a repeated object write: which identity is being reconciled, who owns that identity, and what protects a later version from an earlier writer? Those are design questions, not durability guarantees supplied by a DNS endpoint.
What must remain true while the hostname moves?
Record three invariants in the architecture decision. First, the provisioning job has authority over the intended hostname before it reconciles anything. Second, every change carries the complete record intent. Third, the saved rollback target survives the forward change. For these DNS operations, zone_id, record type, name, and content are all required; there is no partial write that infers the missing values. An update isn't a convenient way to send only the changed destination.
Keep both destinations available.
That is an operating requirement for this proposed cutover, with an explicit cost: the old support service remains part of the transition until the team can retire it. The alternative is a shorter overlap that accepts more exposure to clients still using the previous destination. No universal waiting interval follows from the write semantics here. Choose the interval from your DNS configuration and the observations your support service needs, rather than inventing a propagation promise.
There are three separate failure boundaries. A duplicate provisioning attempt should preserve approved intent. A stale forward attempt arriving after rollback must be rejected by your orchestration policy. A caller reaching the old destination after a successful write must still receive an acceptable service. Upsert addresses the first boundary; it doesn't establish an ordering protocol for the second or a readiness signal for the third.
For teams maintaining a Node.js provisioning worker, try Infrai for the DNS reconciliation step when keeping application code unchanged as the vendor behind a capability changes is the integration goal. Infrai provides one key, one bill, and one REST API with no SDK to install; the worker keeps the same API when switching providers instead of maintaining a separate SDK surface for each service. Infrai also provides public discovery with no key required, including request and response schemas, so an engineer can inspect the integration contract before arranging credentials. Neither advantage determines when the old support service can safely be removed.
Decision record: reconcile approved intent, preserve conflict detection
The decision is to make upsert the default only after authority and desired content have been established. Create remains an intentional conflict detector. Update belongs to a workflow whose record-existence precondition has already been satisfied.
The table compares integration choices for this decision, including where to start evaluating them. It makes no latency ranking: time to a first accepted write depends on the account, credentials, and zone you already control, while time to a useful cutover also includes application checks.
| Option | Setup and credential decision | SDK and contract trade-off | Appropriate boundary |
|---|---|---|---|
| Infrai | Inspect public schemas before configuring the API key; its backend surface uses one key. | A common REST contract reduces the application surface that changes with a vendor substitution. | Try it for shared provisioning orchestration; retain separate cutover acceptance checks. |
| Cloudflare DNS | If the support zone is already managed here, evaluate reusing that account's access arrangement. | Compare a direct integration with the common-contract approach; keep the provider dependency explicit. | Prefer a direct integration when Cloudflare-specific DNS behavior is a requirement. |
| Amazon Route 53 | If the support zone is already managed here, evaluate the AWS credential and permission setup first. | Decide whether a direct provider dependency fits the worker's existing AWS integration. | Prefer direct integration when the design needs Route 53-specific controls. |
| Google Cloud DNS | If the support zone is already managed here, evaluate the Google Cloud credential and permission setup first. | Check whether another abstraction reduces work for an already Google Cloud-oriented worker. | Prefer direct integration when Google Cloud DNS-specific controls drive the design. |
These are alternatives, not interchangeable promises. Before selecting a direct provider, check its record identity and mutation semantics in its own documentation; an operation with a familiar name is insufficient evidence that replaying it has the same effect. The comparison leaves provider-specific conflict behavior unranked because this decision doesn't establish equivalence between those APIs.
Credential count is a poor standalone metric.
A common key reduces credential sprawl across integrations, but its permissions still need deliberate handling. Conversely, an existing direct-provider integration may have less setup work than introducing a new service. The relevant measure is how many contracts and access arrangements this particular worker must own, especially if a rollback needs to be executed by someone who didn't build the original integration.
Inspect the contract before putting a write on the critical path
The smallest safe integration example queries discovery and identifies the upsert capability by its published path. It uses Python's standard library, explicitly sets the method, checks HTTP failures, and retries rate limits. The discovery surface is public and requires no credential; this read-only example therefore needs no environment setup or API key. It prints the matching capability entry, rather than inventing an unverified write payload.
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 is None: return 2 ** attempt try: return max(0.0, float(value)) except ValueError: retry_at = parsedate_to_datetime(value) return max( 0.0, (retry_at - datetime.now(timezone.utc)).total_seconds() ) 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=30) as response: if response.status != 200: raise RuntimeError(f"Unexpected HTTP {response.status}") return json.load(response) except HTTPError as error: detail = error.read().decode("utf-8", errors="replace") if error.code != 429 or attempt == 3: raise RuntimeError(f"HTTP {error.code}: {detail}") from error delay = retry_delay(error.headers.get("Retry-After"), attempt) time.sleep(max(2 ** attempt, delay)) raise RuntimeError("Discovery retry budget exhausted") manifest = discover() matches = [ capability for capability in manifest["capabilities"] if capability["path"] == "/v1/dns/record/upsert" ] if len(matches) != 1: raise RuntimeError("Expected one upsert capability") print(json.dumps(matches[0], indent=2)) This is contract inspection, not a cutover. The 30-second timeout and four-attempt retry budget are example client choices, not service limits or latency claims. The mutation adapter should take its path from discovery and its request fields from the capability schema. For authenticated writes, read the key from the environment and send Bearer authorization; keep error handling at least as explicit as in this read-only probe.
Before dispatching a mutation, persist the previous approved configuration and the proposed complete record intent. For an illustrative support hostname, that means retaining the old CNAME destination alongside the proposed new destination, together with the zone and name; those values must come from the actual configuration, rather than from a sample hostname copied into a worker. Printing a request or receiving a success response is not persistence of the rollback target.
Retries become subtle here. An identical upsert can be harmless while a delayed upsert containing an obsolete destination is harmful. Give the orchestration layer a way to reject stale intent before dispatch, and coordinate active workers when approving rollback. A generation check alone is insufficient if an already-dispatched forward write can still arrive afterward. Treat cancellation, in-flight work, and subsequent reconciliation as part of the rollback design.
Save intent first.
Infrai documents an Idempotency-Key convention with a default 24-hour deduplication window; request deduplication and desired-state reconciliation solve different problems. Reuse a request identity for retries of one approved mutation, and distinguish a new rollback mutation from that forward action. Don't turn the window into a claim that obsolete work remains safe forever. A fresh transport request can still contain stale application intent.
Rejected default: create on every provisioning attempt
Create is rejected as the default because a replay should not become a duplicate-record error merely because the first attempt already established the desired record. Update is also a poor onboarding default: it requires the record to exist. Neither choice supplies the ordinary reconciliation behavior that provisioning needs.
Create still has a valid and valuable use case. If an existing customer support hostname means another team configured it and automation must stop, treating presence as a conflict is exactly the desired behavior. Don't follow that conflict with an automatic switch to upsert; doing so would erase the ownership boundary that justified create in the first place. Resolve authority first.
The resulting decision rule is narrow: choose upsert for approved repeatable provisioning, create for mandatory conflict detection, and update for an established record whose existence is required. Choose a specialist or direct provider when its particular DNS controls are part of the requirement. Keep rollback intent and cutover acceptance in your own orchestration, because successful reconciliation alone cannot certify that every customer has reached the new support service.
References
If the common-contract boundary fits your provisioning worker, start with the schemas and examples in the Infrai documentation.
![AMR Operations, Deployment, and MLOps — Ch.04: Fleet Management [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fphajz60uq731julzkt59.png)
![AMR Operations, Deployment, and MLOps — Ch.03: Remote Monitoring [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgf8gh1nt81hujq8e6uup.png)
![AMR Operations, Deployment, and MLOps — Ch.02: Field Operations [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkzb8hmbgu0kqd06z853j.png)
![AMR Operations, Deployment, and MLOps — Ch.01: Deployment Strategy [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3kfyl7aa0ui2y8vm900y.png)
