Hi all, been exploring Fly recently and so far I’m very excited about what I’m seeing. I’m planning to proceed with migrating an initial small application (a few microservices, one exposed to public and others only private) over to Fly.
I’ve noticed private networking is exposed through both .flycast
and .internal
addresses. I’m trying to determine which of these I should use for my internal networking. So far I see the following pros/cons (I know both do a lot more, but I’m specifically thinking of what I want for my pretty straightforward use case here):
.flycast
:
- Pros:
- Handles autostart/stop so internal services can also autoscale to 0 when not in use.
- Handles load balancing between groups of Fly Machines, including giving preference to geographically closer machines.
- Cons:
- Potentially slightly increased latency due to an added proxy layer between my requests.
- Have to manually allocate one for each internal app.
.internal
:
- Pros:
- Connection occurs directly from machine-to-machine, presumably meaning less latency for internal requests.
- Built in for every app, so no need to do the extra allocation step.
- Cons:
- My internal machines must be running at all times to accept
.internal
requests, so no autoscale to 0 support. - Does not automatically handle load balancing between machines, meaning it’s left up to me (or whatever DNS library I’m using) to manage the intricacies of multiple IPs being returned, as well as managing prioritization of geographical closeness.
- The geographical part may be mitigated via the
top<number>.nearest.of.<appname>.internal
address formatting, but that’s still some degree of management (choosing the<number>
field) that I think.flycast
addresses handle for me.
- The geographical part may be mitigated via the
- My internal machines must be running at all times to accept
Looking at this list, it seems like .flycast
is almost an explicitly superior option as long as I’m okay with an extra proxy layer between my internal services (I am). Does that ring true to others? Is the happy path for most users to just allocate a Flycast address for every internal app and only use that, or am I missing a gotcha here? (And if that is the happy path, why are Flycast addresses not allocated by default?)
Thanks for any insight!