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

_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lists...
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
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
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

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
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
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
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
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
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

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement