Launch HN: Fly.io (YC W20) – Deploy app servers close to your users

626 points by mrkurt ↗ HN
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 a...

266 comments

[ 2.9 ms ] story [ 234 ms ] thread
Congratulations on launching! Would it make sense to think of this like Cloudflare Workers but for any application running in a Docker container? Are there any restrictions on outbound connections?
It's closer to Google's Cloud Run, Heroku, or Fargate since we don't constrain you to a framework and the restrictions that come with it.
There is some overlap with CloudFlare Workers. The big, practical difference is that you can put apps on fly.io that abuse CPUs, write to disk, accept TCP traffic, etc.

Most people we've worked with want to run run apps they've already written (or open source like https://github.com/h2non/imaginary).

Do you scale-to-zero - shut down my containers if they aren't getting any traffic and then start then up again on-demand when traffic starts flowing again?
We don't (yet) because we really loathe slow response times and booting peoples' apps is absurdly slow sometimes. Our #1 feature request for Firecracker is suspend / snapshot functionality so we can do that.

Instead, we give everyone $10/mo of credits and have a really tiny VM that you can run full time for $2.67/mo.

I like the idea of an edge service that is accessible to everyone.

The list of cities looks pretty random to me. In particular I am not seeing anything in the Northeast, New York, etc. In upstate I already have 30ms latency to AWS and Azure in Ohio without terrible tail latency.

There's one in the Newark area:

`ewr Parsippany, NJ (US)`

from https://fly.io/docs/regions/

Are these airport names? Just clicked for me. Is this typical across the industry? I think I remember Rackspace also using ord and iad...
Yes! It's really common to use airport codes for regions. There are some really strange ones, too.

Someday I want to have a datacenter in San Carlos so we can have a SQL region.

The city list does look random, but it's actually the simplest cities to build out with physical servers + anycast.

We _tend_ to do better than AWS on latency to your apps, and from upstate New York you'd probably be connecting to New Jersey. I would be Virginia is quicker than Ohio for you most of the time too.

I have timed Virginia and Ohio and Ohio is 20 ms faster.

I discovered this earlier when I was playing Titanfall and noticed a much lower ping to their Azure data center in Ohio. I confirmed it by setting up my own host in Azure.

I was thinking of switching to Azure but pretty soon AWS opened us-east-2 and I moved my stuff there.

Huh that's really interesting.

I just checked one of the performance tools we use a lot and it's <3ms to connect to fly.io New Jersey from NYC. It's not the best test because datacenter-to-datacenter behaves differently than consumer internet and NYC isn't upstate New York. If you feel like testing I'm curious what you see to https://flyio-ui.fly.dev

Honestly, while I'd love to try this out, I'm afraid of committing to a solution that might not be around long-term, which for me at least overrides concerns of peace of mind and ease of use, and I'm doing a hobby project at the moment.

I'm using bare AWS at the moment because a) they gave me $5k in credits for YC SUS, b) they own the physical servers, and c) I can trust that they'll be around a long time, so I'd rather get locked into AWS proper rather than a service that might be built on top of AWS (e.g. CloudFormation vs. Terraform).

But I get, better than I did two months ago, just how freaking hard it is to build something, anything. This is amazing work, and I couldn't do it. Kudos to you, and I look forward to hearing about your amazing success!

We're not AWS, but: 1) we own physical servers and 2) we're profitable 3) have big public companies as customers.
Oh woah, profitable and own physical servers? You guys are gonna be just fine :)
Physical servers in Vultr right? I believe your geo regions are the same.
So far only Packet, but we'll be expanding soon

edit: those regions are the same because it's the easiest set of cities to roll this out in :)

Congrats! I can see a lot of use cases for picking just a small subset of cities/regions and skipping Google/Amazon/Azure altogether.
Weirdly I feel like the fact that you are profitable and have large customers could be as important a part of your customer pitch as it is your investor pitch - even if the tech is awesome that trust in the organization to stick around is super important (just look at the trouble around stadia haha). It's like those fintech companies that have "but how do we make money?" To make sure customers know "ok they can make money without screwing me over or ending up having to shut down"
> 1) we own physical servers and 2) we're profitable 3) have big public companies as customers

Ironically, these also make you a prime acquisition target (because the product idea rocks), which renders your long-term future unclear.

I was at a company that got acquired before. It was so awful. I'd rather just work on this forever than get absorbed by a big company.
> I was at a company that got acquired before. It was so awful. I'd rather just work on this forever than get absorbed by a big company.

How do your investors feel about this / what's your exit plan?

We feel great about Fly.io :) (I am their group partner at YC)
Could you elaborate? :) Because otherwise, you're possibly sending the same message as what I alluded to (i.e., we feel great because we're expecting a big exit).
Well, whoever buys them would like to keep the customers, as it is already a profitable business. So, even if they completely close the business, they should provide a way to migrate, as nobody likes to loose money/customers.
"I won't use anything from smaller or new companies or Google in case it goes away". That's silly, how is this the top comment? Are people that conservative in tech of all places? This is a docker runtime. If it goes away you'll be up and running again without delay on AWS or anywhere else, you just won't have the edge performance characteristics.
Yes, I'm very conservative. I'm in tech because I want to compound my achievements over time, and I can't do that if I fear the ground shifting underneath my feet. Hence Bezo's mantra "focus on the things that don't change". I hate O(N) efforts, I prefer O(N log N) efforts or better.

Enterprise workloads are far more conservative than I am, those guys spend decades running the same servers. It's why they can focus on sales and customer success and rake in money, which is what actually puts food on the table for their kids.

Depending on the region your infrastructure is located in, AWS doesn't own the datacenter.

For example in the Paris (eu-west-3) region, their availability zones are operated on hardware owned and managed by Telehouse, Interxion and Equinix.

Huh, interesting, I didn't know this. Thanks so much for sharing! Do you have a link? I searched and found all three companies, but I only see links to AWS Direct Connect and hybrid cloud solutions.

I just assumed if they're creating their own chips, they're probably creating their own servers, datacenters, networks, etc. but I guess I shouldn't jump to conclusions.

Did y'all rack the servers that the containers run on? Or is it VMs running the containers? Just curious :)
We got someone else to rack them. Customer apps are VMs on top of the physical servers we lease. At scale we'll build our own datacenters, but at scale we can get not-me to do that.
This is great @mrkurt

Any plans to launch any Datacenters in India? could not find any here - https://fly.io/docs/regions/#welcome-message

No timeline yet but we're eager to get into India and South America when we can
India is the next cloud hub. AWS and Azure are earning hands over fist here.
We are definitely missing out on customers because we aren't in India and South America. It's expensive to solve that problem but we're getting close!
Thanks! This is a very cool tool. Wish you all the best.
This is an awesome idea and it looks like you guys are executing on it beautifully. Congratulations!

Out of curiosity, what kind of customers/teams are asking you for gRPC support? Is this coming from your enterprise customers or from smaller teams?

We actually noticed people asking about gRPC on Hacker News, especially on Cloud Run posts:

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

It's usually small teams, individual devs who want gRPC. Even if it's within a large company, it's almost always one technical person.

Actually, one more question...do you guys scale compute and data layers separately, or are they tightly coupled within the same container?

I was looking at containerized PostgreSQL on AWS because I want to colocate a job scheduling tool (pg_cron) with the database process, but RDS doesn't support that extension. Apparently (or at least I hope), ecs-cli compose supports docker volumes through EBS, which is the same base as EKS persistent volumes. There's next to no information for ECS + EBS though, everybody uses EC2 or full on EKS.

I was just thinking, if you needed to handle excessive read load on small quantities of data, having separate data layers would enable you to autoscale db instances while still having the same volumes, instead of using an entirely separate caching layer which could introduce bugs and increase maintenance overhead. If you guys had native HA with docker exec access and passed savings to consumers that would be huge for me and my use cases.

Right now we're best suited for app servers, databases won't (yet) run very well on fly.io. We are trying really hard to focus on what we have because it's so valuable but we love DBs so much we might end up trying to "solve" them soon.
Fair enough! I signed up, looking forward to DBs on Fly.io!

(Also I got permission denied when attempting to curl the script when writing to /usr/local/bin, I needed sudo. I'm on Ubuntu 19.10 Eoan Ermine. Not sure whether security implications for `curl | sh` outweigh convenience, but I trust you guys and my connection. :P)

But your most valuable customers will need to interact with an app server plus database for any real life use case. Can you share some applications where only placing the app server close to user works? Is the database back in Virginia?
You are mostly right, there are a surprising number of problems that don't need much database interaction. Lots of image generation, video workloads, game servers, etc.

One of the things we want to do, though, is make "boring" apps really fast. My heuristic for this is "can you put a Rails app on fly.io without a rewrite?".

Many of these applications add a caching layer. Normally if someone wants to make a Rails app fast, they'll start by minimizing database round trips and cache views or model data. If somone has already done this work, fly.io might just work for this app since we have a global Redis service (https://fly.io/docs/redis/).

We have experimented with using CockroachDB in place of Postgres to get us even farther, but it doesn't work with most frameworks' migration tools.

We're also thinking of running fast-to-boot read replicas for Postgres, so people could leave their DB in Virginia but bring up replicas alongside their app servers.

If you've seen anyone do anything clever to "globalize" their database we're all ears.

I’m extremely impressed with how slick your Heroku integration is. We thought about moving over to render but the dev ux just isn’t there like Heroku. I would be fine with paying for a read replica on the west coast that was always running if you can make it as easy the rest of your Heroku integration.
I've seen https://macrometa.co take a stab at an edge database, but their guarantees (consistency / correctness) don't really infuse any sort of confidence in me [0]. https://yugabyte.com is another global scale database that competes squarely with cockroach-db, though I haven't used either.

Cloudflare Workers KV has the simplest model, with a central-db that transparently and eventually only replicates read-only, hot-data specific to a DC but writes continue to incur heavy penalty in terms of operations-per-second, cost, and latency.

In our production setup, we back Workers KV with a single-region, source-of-truth DynamoDB [1] and employ DynamoDB Streams to push data to Workers KV [2], that is,

Writes (control-plane): clients -> (graphql) DynamoDB -> Streams -> Workers KV

Reads (data-plane): clients -> Workers KV

Reads (control-plane): clients -> (graphql) DynamoDB

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

[1] We really should switch to QLDB once it supports Triggers.

[2] We do so mainly because we do not to be locked-down to Workers KV, especially at its very nascent stage.

Hi Ignoramus - founder and CEO of Macrometa here - regret that our first attempt at explaining our consistency model caused confusion last year. Here's a link to the research paper that describes our architecture and consistency model.

https://bit.ly/HPTS-Macrometa

We got accepted in High Performance Transaction systems last year for the innovations around CRDTs for strong eventual consistency (SEC) with low read and write latencies.

Im trying to figure out how to provide a simple light weight way for fly.io users to use our global DB in their apps. It would allow a full stack to run at the edge with the compute on fly.io and the data on Macrometa either directly on fly.io or a nearby PoP (same city). Will update

I’m experimenting with this, they have Redis at every edge, with a way (SELECT 2) to send commands to all edges with eventual consistency. No RDBMS yet, said they’re looking at CockroachDB.

I’m running a single central Postgres server on Heroku and planning to use the Redis edges to cache.

Just curious, how do you handle non-HTTP(S) traffic to applications? You said applications get dedicated IP addresses (I assume v4 and v6). Not having the ability to multiplex an IPv4 address (e.g. if I deploy an application that accepts connections on port 1337/TCP) will get expensive quite quickly, so I wonder how you solve this problem! :)
Do you mean it would get expensive to run multiple applications that listen on a single TCP port?

It _might_, if you need a bunch of ipv4 addresses it'll add up fast. But you could always put your own router app in place to accept that port on one IP, find the right ipv6, and forward connections along.

Is it already possible or do you guys plan to add support for attaching persistent storage to applications deployed with fly?

I am building a search engine and this would let me derive your performance benefits using region-scoped databases and search indices.

That's awesome, your use case is perfect for region scoped persistent storage.

We're testing persistent storage privately with a few customers now and the results are exciting. My favorite is using minio as a private global s3 for caching.

What are you using for the index storage engine?

I would be really interested in Fly if it abstracted persistent storage. An exciting use case to me would be something that doesn’t with “...for caching.”
Pretty nice to see Rust being used for network performance code. Do you have any learning using it to share? Would you rather use C++ if you'd have to do it again? Do you feel more confident in your code? Do you feel it was slower or quicker to write code compared to C++
We attempted C++ about a year ago, but I was never confident in our ability to clean up memory allocations (we had leaks) or avoid undefined behavior (we had segfaults).

I definitely feel more confident about our Rust code. It's no silver bullet, but it prevents a lot of unsoundness with its compile-time guarantees.

I can't really compare to C++, but it's easy to write new code or refactor old code. It took some time to get there, though.

All in all, I would recommend Rust wholeheartedly. The ecosystem is growing and getting more mature every week. The community is very helpful in general, especially the tokio folks.

Glad to hear you all are doing great with Rust! :D
Thanks for sharing! It's nice to hear about this learning. Also, wasn't aware of tokio, it looks real nice.
Had a look at the network pricing. I wouldn't host anything there. Takes "the cloud is expensive" to a whole other level.
How do you currently host your Docker container at edge nodes?

(It's a facetious question: unless you're a $100B company you're not doing anything of the sort.)

Why would I care? I have <30 ms ping to AWS. Maybe there's an argument for this for something like realtime-ish like games, but this feel likes a massive premature optimization for anything solving typical business problems.

That's not meant to be a snarky question, I genuinely don't understand what business problem that's going to be solved by saving at most 30 ms. Anything written in Rails/Django, talking to a DB, etc. is going to have request latency dominated by other parts of the stack.

We have some benchmarks comparing us to Heroku (on AWS) and the performance gains from faster networking alone are nothing to sneeze at: https://fly.io/blog/turboku/
If the value prop is that you're Heroku, but faster, I can understand that.

I think it's misleading to say that deficiencies of Heroku have anything do to with AWS though. It's really, really easy to set up anycast [https://aws.amazon.com/global-accelerator/] with ECS [especially if you're willing to pay for Fargate]. If your product does something meaningfully different than that, I'd love to know more.

NB: I'm in no way affiliated with AWS or Heroku, just have experience with both in the past.

> Takes "the cloud is expensive" to a whole other level.

What do you mean by this? It seems pretty much on par with the expensive cloud pricing of the big players.

Congratulations on the launch! I've been following fly.io ever since I stumbled on it 2 years ago.

A few questions, if I may:

> 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.

Does it mean the backhaul is private and not tunneling through the public internet?

> 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 avaible instance.

I use Cloudflare Workers and I find that at times they load-balance the traffic away from the nearest location [0][1] to some location half-way around the world adding up to 8x to the usual latency we'd rather not have. I understand the point of not running an app in all locations esp for low traffic or cold apps, but do you also "load-balance" away the traffic to data-centers with higher capacity? If so, is there a documentation around this? I'm asking because for my use-case, I'd rather have the app running in the next-nearest location and not the least-load location.

> The router terminates TLS when necessary and then hands the connection off to the best available Firecracker VM, which is frequently in a different city.

Frequently? Are these server-routers running in more locations than data centers that run apps?

Out of curiosity, are these server-routers eBPF-based or dpdk or...?

> Networking took us a lot of time to get right.

Interesting, and if you're okay sharing more-- is it that the anycast setup and routing that took time, or figuring out networking wrt the app/containers?

Thanks a lot.

[0] https://community.cloudflare.com/t/caveat-emptor-code-runs-i...

[1] https://cloudflare-test.judge.sh/

> Does it mean the backhaul is private and not tunneling through the public internet?

Backhaul runs only through the encrypted tunnel. The Wireguard connection itself _can_ go over the public internet, but the data within the tunnel is encrypted and never exposed.

> I use Cloudflare Workers and I find that at times they load-balance the traffic away from the nearest location [0][1] to some location half-way around the world adding up to 8x to the usual latency we'd rather not have. I understand the point of not running an app in all locations esp for low traffic or cold apps, but do you also "load-balance" away the traffic to data-centers with higher capacity?

This is actually a few different problems. Anycast can be confusing and sometimes you'll see weird internet routes, we've seen people from Michigan get routed to Tokyo for some reason. This is especially bad when you have hundreds of locations announcing an IP block.

Server capacity is a slightly different issue. We put apps where we see the most "users" (based on connection volumes). If we get a spike that fills up a region and can't put your app there, we'll put it in the next nearest region, which I think is what you want!

CDNs are notorious for forcing traffic to their cheapest locations, which they can do because they're pretty opaque. We probably couldn't get away with that even if we wanted to.

> Frequently? Are these server-routers running in more locations than data centers that run apps?

We run routers + apps in all the regions we're in, but it's somewhat common to see apps with VMs in, say, 3 regions. This happens when they don't get enough traffic to run in every region (based on the scaling settings), or occasionally when they have _so much_ traffic in a few regions all their VMs get migrated there.

> Interesting, and if you're okay sharing more-- is it that the anycast setup and routing that took time, or figuring out networking wrt the app/containers?

Anycast was a giant pain to get going right, then Wireguard + backhaul were tricky (we use a tool called autowire to maintain wireguard settings across all the servers). The actual container networking was pretty simple since we started with ipv6. When you have more IP addresses than atoms in the universe you can be a little inefficient with them. :)

(Also I owe you an email, I will absolutely respond to you and I'm sorry it's taken so long)

Any chance you have more details on GP's question about the tech basis of the router (ebpf, dpdk)? I didn't find this component among the OSS in the superfly org.
Doh, missed that. We're not doing eBPF it's just user land TCP proxying right now. This will likely change, right now it's fast enough but as we get bigger I think we'll have more time to really tighten up some of this stuff.
> Wireguard + backhaul were tricky (we use a tool called autowire to maintain wireguard settings across all the servers).

I'm guessing that's? https://github.com/geniousphp/autowire

Looks like it uses consul - is there a separate wireguard net for consul, or does consul run over the Internet directly?

Consul runs over a different connections with mutual TLS auth. That's the project we use!
Hey, I'm the tech lead of Workers. I don't want to intrude too much on this thread, but just wanted to say: we don't do any special load-balancing for Workers requests; they are treated the same as any other Cloudflare request. We use Anycast routing (where all our datacenters advertise the same IP addresses), which has a lot of benefits, but occasionally produces weird routes. Often this relates to specific ISPs having unusual routing logic that, for whatever reason, doesn't choose the shortest route. We put a lot of effort into tracking these down and fixing them (if the ISP is willing to cooperate). We do sometimes re-route a fraction of traffic away from an overloaded datacenter by having it stop advertising some IPs, but if the internet is working as it should, that traffic should end up going to the next-closest datacenter, not around the world. When you see requests going around the world, feel free to file a support request and tell us about your ISP so we can try to track down the problem and fix it.
(comment deleted)
Congrats on the launch! If you're looking at CockroachDB (looking at some other comment on this thread), you should reach out to us if you haven't already. Your design here seems like the exact kind of thing we're hoping to push towards.
Curious - what are you using to power/style your docs website?
Predominantly, middleman, markdown and a splendid web designer.
Who do you peer with in Europe? I see in the US you use Packet (https://www.packet.com/) but I couldn't find any information about the EU, or do you focus on the US market for now?

We're also a LIR and want to build an anycast network (we anonymize streaming data), any helpful resources you can share on this?

Cool product btw! I think this will be a very interesting area in the coming years, the fact that you offer Docker containers is a good USP as compared e.g. to Cloudflare workers, we might even consider using your service ourselves if you provide service in Europe (our customers are mostly in Germany)!

We actually have servers in North America, Europe (including Frankfurt), and Asia Pacific. The complete list is here: https://fly.io/docs/regions/#discovering-your-applications-r...

Building an anycast network is expensive. That's part of what we want to make accessible to devs. There are a couple of companies (like Packet, and possibly Vultr) you can lease servers from that will handle anycast. These tend to get you into the same ~16 regions, expanding past those can be difficult and even more expensive. That's what we're working on now.

Cool, thanks! I know Vultr but I'm looking for a second provider to fulfill the multi-homing requirement. And yes it's expensive and I think it's a valuable service to developers you're offering!
Having a more prominent 'locations' or 'regions' link on the website navigation/homepage might be helpful. It was the first thing I looked for even before pricing. It's currently a bit hidden in the docs.

I know locations are probably not super important to you guys as you see it as a starting point or something super flexible, but I always find myself drawn to the concrete stuff like that. Largely as a measure of how mature the product is.

Good call. We have a neat visualization we want to build to show what's happening, but we don't need to wait on that to make it more obvious.
Also a map would be a great visualization. A list doesn't really tell me much without a frame a reference
No south america :(
Yeah not yet. :sob: We're going to expand there and India as fast as we can.
Good to know, this looks great!

Btw any plans to support Java applications?

If you can build it in a Docker image or if you can deploy it to Heroku, then we support it :)

If it doesn't work, it's a bug.

Awesome, I had a misunderstanding it was only GoLang because of your github repos, get ready to get filthy rich with this.

If you ever come to SA, never partner with Localweb ( biggest/major local server provider ) they are garbage.

Curious - In what way would building an Anycast network be expensive ?
Running your own bgp in multiple data centers requires some reasonable network engineering skills. Anycast, specifically, is a complex beast. If you use multiple transit providers, you have to continuously tweak things to make sure people aren’t getting weird routes. Network providers like to send people over the cheapest (in dollars) routes sometimes, which makes things slow.
Great introduction to the technology! I rarely see such a clear explanation of how new products work.
This is my favorite Hacker News comment of all time.
What problem does it solve? Because latency is currently not an issue with all the regions from current cloud providers from my perspective. And for all static stuff you can use a CDN that has pop all arround the world / cities.

Not sure I understand the use case of a single Docker image in a city outside of your entire backend services, especially the DB. If your Docker image talks to something else on AWS / GCP for example you add a lot of latency using public routes.

It looks more like: https://workers.cloudflare.com/

This basically bumps the amount of behavior you can stuff into the edge by several orders of magnitude. Previously, Lambda@Edge will like, maybe validate a JWT. Now, you can put like half your app in there. It sounds like a tiny incremental change but it's big enough that it simply redefines what's even possible in a POP.
I'm interested, what is now possible with this? Is it high bandwidth VR sort of stuff?
This is not an area I'm in a lot, so I may be wrong, the cloudflare workers page GP mentioned says that you only get 10ms CPU time per request (or 50ms with the paid plan). I'm assuming lambda etc have similar limits. So presumably anything that takes longer than 10/50ms.
lambda can run up to 30m I think (idk about lambda@edge). CF Workers fail when trying to use something like node-unfluff, because the CPU time takes too long.

This seems to me, like a more controllable lambda@edge.

The containers on fly.io can go up to 8CPUs. So you can do a lot of computation for images, video etc.

They can also accept any kind of TCP traffic (and we're trialing UDP), so lots of interesting network services. This is especially interesting for people who want to do live video.

AND we have disks. So you can deploy Varnish, or nginx caches, etc. This is something we enable by hand per app.

I didn't find documentation about the disks: size, ssd/hdd, price?
Ah, I didn't make this obvious but that's a feature we're currently testing. We can enable ephemeral disks on apps, but it's not generally available. They're local SSDs, size is variable (still figuring that out). They're free right now. ;)

If you want to try them out, you can create an app and then an email to either me or support at fly.io and we'll turn them on for you.

They originally had (and seem to still have) the same JS runtime at the edge to give you a smart CDN/reverse proxy.

They just updated it from being JS only to being able to run any Docker image. Cloudflare gives you a persistent key/value store and Fly provides a non-persistent Redis cache.

You don’t have to move your entire app but there are plenty of use-cases where you can move more logic to the edge.

We’re moving the JS apps to just run on Deno containers. Deno is fabulous.
This is the most intriguing thing for me, perhaps second only to the fact that you guys are working with Rust. I have followed Deno since it was announced and it has been fascinating to watch it evolve. How much Deno code do you all have working in production right now?
Only a little. It works very well, once we port our edge js library (https://github.com/superfly/edge) to Deno we will move over some things handling hundreds of millions of requests per day.
There's a whole bunch of use cases people have today that don't require a database. Here's a few that I'm excited about:

  - image, video, audio processing near consumers
  - game or video chat servers running near the centroid of  people in a session
  - server side rendering of single page js apps
  - route users to regional data centers for compliance
  - graphql stitching / caching (we do this!)
  - pass through cache for s3, or just minio as a global s3 (we do this!)
  - buildkite / GitHub Action agents (we do this!)
  - tensorflow prediction / DDoS & bot detection
  - load balance between spot instances on AWS/GCP
  - TLS termination for custom domains
  - authentication proxy / api gateway (we do this!)
  - IoT stream processing near devices
CloudFlare Workers is a fantastic serverless function runtime, but we're a layer lower than that. You can actually build it on top of fly.

edit: formatting

Very impressive work. Just curious if you are worried about the big guys (AWS, GCP, etc) coming in and offering a similar service? If so, are you hoping DX will help act as moat?
That's always a concern, but not something we focus on. DX is a big deal. That's why Heroku and CF Workers are so popular despite everything the big guys offer.
I vaguely remember that fly.io used to have a platform based on v8 isolates, I’m guessing the new platform is a bit of a pivot? I’m curious, was it just to support more platforms, or we’re there technical challenges with isolates?
It's a bit of a pivot but still in the same space. Here's a few reasons why we landed on this:

- Our JS apps require customers to write new code to solve problems. That’s a tough sell for companies with existing code they need to make fast.

- The more people used JS apps the more unexpected things they wanted to do. Like tensorflow at the edge, audio and video encoding, game servers, etc. No way we could support any of that without moving down the stack.

- Reimplementing the service worker api was a slog we didn’t want to continue. Deno is fantastic and we’d rather just run those apps than compete with it

Do you guys plan to add an offering for a distributed database that we could match with this compute? That way we could build entire application on edge without buying into the FaaS movement.
That's something we're certainly thinking about, but we need to get compute right first!
> That way we could build entire application on edge without buying into the FaaS movement

So you want to be able to upload your code and have someone manage the infrastructure and datastore.

Isn't that the definition of FaaS?

Partially, and there's plenty of hosts that offer it. We're trying to make things like full stack Rails monoliths at the edge possible.
My definition of FaaS is each controller living its own life and deployed independently behind an api gateway. This is a PaaS because only the infrastructure is managed and I can deploy my whole application in one docker image.
That’s a pretty good definition of FaaS.
That sounds like the definition of “utopia” to me.
Hi, this is a very cool product and I am planning a project that I think could use it.

The question I have tho: How do you take advantage of the gains from this if you still need one master strictly consistent db for writes?

Would a system design pattern to take advantage of fly.io be to have read only replicas on each geographic deploy or to only have region specific persistance? Apologies if this was already answered I read thru everything I saw. Thanks!

The "simplest" gains come from adding an in memory cache, we include Redis for this and some apps work really well just leaving the DB where it is, caching aggressively, and running close to users: https://fly.io/docs/redis/

Read only replicas are a great first step for most applications. I'd probably do caching first, then replicas (which are kind of like caching).

Region specific persistence is one way to improve write latency, and I think the simplest for most apps. We've experimented with CockroachDB for this (it keeps ranges of rows where they're most busy), and you can actually deploy MongoDB this way.

Thanks that totally makes sense! I look forward to playing around with this.
PM@cockroach labs here. Which tools did you experiment with? We've been working to increase our tooling capabilities!
We got hung up with the migration tooling for popular frameworks. If we can get those migrations to work with minimal drama, we want to basically show people “global full stack” with app + cache + database.
> 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.

I like this, not having caps is a major problem with some of your competition for smaller projects/companies where the max caps are more important then availability.

I heard of more then one project which mad some mistake them self wrt. some code generating request in their client. Or had some other reason why they had insane usage spikes, causing them to basically go bankrupt in a mater of a view hours. Not even days. (Through one project got lucked out as if I remember correctly Amazone bailed them out to prevent bad press).

IMHO for the majority of server application availability is important but only up to a certain cost. After which unavailability for some time is better, even if you lose some customers. (Yes, like always there are exceptions).

I don't think I like the failure mode of your app getting slower (losing your ApplicationDN) right at the time it's really popular. I don't have a better solution though.
(comment deleted)
This is tricky since every app has different performance and budget constraints. We try to minimize footguns by starting with sensible defaults. Over time we'll provide more options so you can tune scaling and placement yourself. We're also happy to help if you need!
maybe if you go over, you automatically add ads to the page or something.
A "donate" button when the current remaining budget would last for less than 100 minutes.
> I don't have a better solution though

Don't host in such a way that you're paying for traffic... Hetzner, OVH and Packet all have dedicated servers where you don't pay for the traffic, inbound or outbound.

Edit: judging by other comments here, it might seem like US zone of Fly.io is in fact hosted in Packet so they are probably themselves not paying for the traffic. Maybe they are using Hetzner for the EU zone (or OVH for that matter).

Packet charges for outbound bandwidth. The places you can get close to free on outbound bandwidth don’t give you the ability to do anycast and tend to over subscribe their networks.

We’d like to grt network prices down but we can’t run our service on ovh or Hetzner.

Vultr does BGP if you have a routable subnet and AS. Just open a support ticket.
Yep! We've been experimenting with Vultr, their physical servers are only in 7 cities. I hope they expand.
But your server going down because of high load instead of being shut down by a bill breaker doesn't make that much difference.
Unless your popularity pays your bills, it's the most graceful degradation you can have.
The solution is to set your limit pretty high (100 times your average or so) or, alternatively, have shorter limit intervals - 100 times your daily bill is still a lot less harmful than 100 times your monthly bill.

The only 'real' solution is proper alerting, but even then it's pretty easy to rack up a bill of several thousand dollar before anyone realizes what's going on.