Launch HN: Fly.io (YC W20) – Deploy app servers close to your users
recommended by 3 users | 2020 | 626 points by mrkurt | cloud & devops | original thread |

Hello Hacker News! We're Kurt, Jerome, and Michael from fly.io (https://fly.io/). We're building a platform to run Docker applications close to end users. It's kind of like a content delivery network, but for backend servers.

I helped build Ars Technica and spent the majority of my time trying to make the site fast. We used a content delivery network to cache static content close to anonymous readers and it worked very well for them. But the most valuable readers were not these, but the ones who paid for subscriptions. They wanted personalized content and features for interacting with the community – and we couldn't make those fast. Content delivery networks don't work for Ars Technica's best customers.

Running Docker apps close to users helps get past the "slow" speed of light. Most interactions with an app server seem slow because of latency between the hardware it's running on (frequently in Virginia) and the end user (frequently not in Virginia). Moving server apps close to users is a simple way to decrease latency, sometimes by 80% or more.

fly.io is really a way to run Docker images on servers in different cities and a global router to connect users to the nearest available instance. We convert your Docker image into a root filesystem, boot tiny VMs using a project called Firecracker (recently discussed here: https://news.ycombinator.com/item?id=22512196) and then proxy connections to it. As your app gets more traffic, we add VMs in the most popular locations.

We wrote a Rust based router to distribute incoming connections from end users. The router terminates TLS when necessary (some customers handle their own TLS) and then hands the connection off to the best available Firecracker VM, which is frequently in a different city.

Networking took us a lot of time to get right. Applications get dedicated IP addresses from an Anycast block. Anycast is an internet routing feature that lets us "announce" from multiple datacenters, and then core routers pick the destination with the shortest route (mostly). We run a mesh Wireguard network for backhaul, so in flight data is encrypted all the way into a user application. This is the same kind of network infrastructure the good content delivery networks use.

We got a handful of enterprise companies to pay for this, and spent almost a year making it simple to use — it takes 3 commands to deploy a Docker image and have it running in 17 cities: https://fly.io/docs/speedrun/. We also built "Turboku" to speed up Heroku apps. Pick a Heroku app and we deploy the slug on our infrastructure .. typical Heroku apps are 800ms faster on fly.io: https://fly.io/heroku/

We've also built some features based on Hacker News comments. When people launch container hosting on Hacker News, there's almost always a comment asking for:

1. gRPC support: apps deployed to fly.io can accept any kind of TCP connection. We kept seeing people say "hey I want to run gRPC servers on this shiney container runtime". So you can! You can specify if you want us to do TLS or HTTP for an app, or just do everything yourself.

2. Max monthly spend: unexpected traffic spikes happen, and the thought of spending an unbounded amount of money in a month is really uncomfortable. You can configure fly.io apps with a max monthly budget, we'll suspend them when they hit that budget, and then re-enable them at the beginning of the next month.

One of the best parts of building this has been seeing the problems that developers are trying to solve, often problems we didn't know about beforehand. My favorite is a project to re-encode MP3s at variable speeds for specific users (apparently the Apple Audiobook player has no option for playback speed). Another is "TensorFlow at the edge" — they trained a TensorFlow model to detect bots and run predictions before handling requests.

We're really happy we get to show this to you all, thank you for reading about it! Please let us know your thoughts and questions in the comments.

3 users recommended this thread. What they said:
up6w6 Jan 20, 2021 | on: Launch HN: Seed (YC W21) – A Fully-Managed CI/CD Pipeline… | context
ignoramous Feb 18, 2021 | on: Dapr – Distributed Application Runtime | context

> I want to basically move as much as possible in the direction of "cloud native best practices and patterns" but I want to incur the smallest possible cost for doing so in terms of effort and actual costs.

Check out fly.io [0] which is likely the "smallest possible cost" you'd incur that otherwise may bloat up due to (drawing parallels to HashiCorp products) packaging and deploying with Waypoint, orchestrating with Nomad, and setting up networking with Consul. Dapr, if I understood it correctly, replaces only Waypoint and Consul, you're still left to deal with orchestration.

[0] https://news.ycombinator.com/item?id=22616857

tptacek Apr 9, 2021 | on: Docker without Docker | context

Just a note for people who might not be aware: whatever marketing savvy you pick up from this post, one person you should credit is HN's own Dan Gackle. Check this out:

https://news.ycombinator.com/item?id=22616857

We wrote this piece (well, "they" did; I hadn't joined up with Fly yet --- this piece is part of why I did) but Dan edited it. I got to read the back-and-forth and revisions when I got here and it was bananas how much effort he put in. In blog posts, I just keep doing what he suggested in that Launch piece. Seems to be working?

Go look at all the "Launch HN" pieces. I think a lot of them are comparably informed by Dan.

I'm commenting about this because I think it's super interesting that one of YC's secret weapons is the moderator for HN, who informally moonlights as the editor for YC launch posts, and is spooky good at it.