Include Org names in the Domain Name

We’re currently setting up a middleware to have branded domains, without the overhead of managing DNS records (using Fly as a PaaS provider for running user code).

The major concern is validating the Apps are our own; either check on the fly, or setup a database to be updated whenever we create a new app.

It’d be convenient to have org-scoped domains, that only connect if the App is associated to the respective Org.

ie, for an app does_exist on org myorg: fail success success fail

Note, this is not a request for org-scoped app names; only a request to have domains that will not serve traffic for apps not under a specific organisation.

Alternative: If there’s a way to have all apps in an org share the same ipv4 reliably, this would also work for us

I don’t work for Fly so I can’t help with the feature suggestion, but focusing on what you’re trying to achieve: I expect you’ll encounter quite a few challenges if you try to avoid any sort of datastore, especially with certificates involved.

Here are a couple of scenarios that come to mind:

The traditional way to handle this would be to use a wildcard record (e.g: * which points to server(s) responsible for routing requests to the appropriate tenant based on some internal lookup. Removing the datastore and using a Cloudflare worker style runtime determination of the destination based on parsing the domain name and then calculating what the domain should be is will cause you a lot of headaches as soon as you encounter some of the weird things customers need/want. You’ll still remember writing this post when you get your first request to add some special code for one special high-paying customer, and before you know it, you’ve got middleware filled with lots of special cases – and shipping a bug in it can take down all your customers.

Personally, I’d use DNS records until I got to the point where it was too costly. There’s a little extra upfront work required to write code to publish DNS records, but it’ll pay dividends as soon as you have to do something that deviates from your current use case.

A good principle to keep in mind when managing infrastructure for customers: there’ll always be a customer with deep pockets who wants something ridiculous, so build a system that can capture that revenue without needing a rethink.

[1] You should do this regardless of approach, so just in case you haven’t already planned to, definitely use a customer-specific domain. Fly have, GitHub have, Google Cloud Run uses etc.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.