Kin

Kin

Can a bad internet connection cause issues with websockets in Phoenix?

I am new to Phoenix keep but I keep hearing that there is an issue with websockets when you are on a bad internet - mostly mobile phones in cars, subway, trains, remote locations, etc.

Somebody also mention long-polling - is that a default setting?

What is your experience?

Also how does this affect when you want to use Phoenix for mobile iOS, Android apps via the API pipeline. Is it similar?

I am new to Phoenix, so sorry if those questions are dumb.

Most Liked

christhekeele

christhekeele

These are all good questions!

  1. Phoenix does not require use of sockets (be it websockets or long-polling backend), so it degrades just like any MVC framework under poor network connectivity.

  2. If you do choose to use sockets, it degrades just like any other websocket-driven UX under poor network connectivity. Possibly better, because of the long-polling fallback, I don’t remember how that works out of the box.

  3. LiveView is a framework for building soft-realtime bi-directional UI experiences on top of sockets, so its performance characteristics fall into point 2. Note that LiveView is not required to build a Phoenix app, nor even recommended for the average use-case.

  4. If you are powering a mobile application via calls to a Phoenix API you are using standard MVC, so see point 1.

  5. If you’re curious, try running some simulations. Most browsers have good support for simulating network latency, and Phoenix even comes with special tooling for simulating socket latency in particular!

In general, Phoenix is a web framework, so degrades like any web framework when packets can’t get through. LiveView is a realtime UI framework, so degrades like any constant-connection application when packets can’t get through. Nothing unique to Phoenix: bad internet impacts access to web apps.

Where Next?

Popular in Questions Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
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
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
dotdotdotPaul
Okay, I’m having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I’m sure I’...
New

Other popular topics Top

New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31013 112
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
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
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
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

Latest on Elixir Forum

We're in Beta

About us Mission Statement