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
These are all good questions!
-
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.
-
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.
-
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.
-
If you are powering a mobile application via calls to a Phoenix API you are using standard MVC, so see point 1.
-
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.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









