tadasajon

tadasajon

How does Fly.io work? Isn't the database the performance botleneck?

The consensus in the elixir community seems to be that Fly.io is the way to deploy Phoenix apps, and I have successfully done this myself, but I don’t understand how it works.

The docs state:

We want you to run your full stack close to users, whether it’s a simple web service or your database-backed opus with multiple supporting services.

But what if I have users all over the world? Does Fly.io constantly move my app around to be close to different users? What about the database – certainly it should be the single source of truth, so I don’t see how it can be moved easily.

What does Fly.io offer that is different from just picking a datacenter in some location that you think will be close to the majority of your users and just deploying your app there?

Most Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

I think Fly is doing great stuff, and I think they’re a great default for deployment. That said, I think there’s still a LOT of us deploying Phoenix in more traditional cloud environments, or in even more traditional servers. Fly is definitely not the majority of deployments, and I would be surprised if they were a plurality.

I am not a Fly expert, but my sense is that they help in two ways:

  1. LiveView in particular adds client → server round trips for rendering that often do not hit the database. These are helped by having the app closer to the client.
  2. Fly has global replicas for postgres, which basically let you have read replicas colocated near your apps near your users at the edge. This doesn’t help writes, but it definitely cuts down on latencies for reads.
gregvaughn

gregvaughn

Look up Mark Ericksen’s talk at last year’s ElixirConf for more details. It’s some clever stuff.

sorentwo

sorentwo

Oban Core Team

From polls, conversations, and a lot of support I can confidently say elixir apps are deployed all over the place: GCP, AWS, Heroku, Render, Gigalixir, Hetzner, and Fly come up regularly (though Gifalixir and Heroku are declining).

Where Next?

Popular in Questions Top

Tee
can someone please explain to me how Enum.reduce works with maps
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New

We're in Beta

About us Mission Statement