A healthtech tenant subdomain signup flow has several costs: DNS writes, provisioning checks, operational evidence kept for investigation, and the work of recovering an incomplete signup. Start with the retained evidence. In an illustrative planning model, 100 signups per day with 3 retained events each produce 9,000 events over 30 days. Keeping the same events for 7 days produces 2,100. Those are assumptions for sizing, not observed traffic or a vendor quote. The dominant term in that retention model is events per day multiplied by days kept; a cheaper DNS write does nothing to reduce it.
Short answer: provision the tenant subdomain by upserting its CNAME with the stored zone_id during signup, and roll back the new tenant record if the DNS write fails. Keep the destination hostname in configuration.…