smanza
Hello.
I’m developping a P2P network using Elixir and I’m wondering if I must go to raw TCP or using HTTP.
Currently I thought to use Ranch for internal communication and Phoenix for external communication but thinking if TCP based services are worth in term of performance vs HTTP calls.
Thanks
Trending in Discussions
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
New
The obligatory hello world thread!
Who are you and where are you from? :stuck_out_tongue:
New
@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project.
My initial shotgu...
New
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog
It says that Fly is going all-in on sprites, which is a worry ...
New
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using.
We’re particularly inte...
New
Is there a word for the ~> symbol used in Version strings?
Do you also just call it a Squiggle Arrow™ ?!
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
Latest Phoenix Threads
Chat & Discussions>Discussions
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
- #blog-post
- #phoenix_html
- #iex
- #ai
- #graphql
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex











Showing Posts 1 to 5- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
hauleth
If you are using HTTP/2 then performance hit from doing many HTTP requests is smaller. Also there are WebSockets if you want. However we will not be able to provide you more help without more details about your application.
smanza
My application is a decentralized P2P network communicating which requires a high throughtput and low latency. Nodes need to keep long connection to monitor any disturbance in the network.
Currently I’m using Ranch for the P2P communication with custom message passing using ETF.
But as many people advertise a lot Phoenix and TCP based service not so much, I’m wondering the best approach, evenif services tend to be faster require less overhead and helps to keep long living connection.
WebSockets and TCP are quite similar indeed, but I’m wondering if Phoenix supports WebSocket without browser , only node to node.
al2o3cr
“P2P” and “ETF” are two concepts that probably shouldn’t be put too close together:
Unless you trust all the nodes, in which case “P2P” is a bit of a misnomer.
To the original topic, I recommend that you get your network working with whatever transport makes it straightforward to implement, then measure extensively.
smanza
In fact I’m using always
:safein:erlang.binary_to_termand I have another mechanism to avoid issue such as Anti Corruption Layer and Shared Signature verification to ensure trust.Thanks for the advice.
After thinking, I’m will go with Ranch TCP for now, Phoenix or Web stuff does not matter for my P2P network.
bottlenecked
Hi there, latency and throughput are at odds- when you optimize for one the other usually suffers. https://medium.com/@kentbeck_7670/inefficient-efficiency-5b3ab5294791
I’m not quite sure what you’re building, but creating a layer to abstract communications would allow you to go with HTTP and switch implementations later if you need to. HTTP will most probably allow for faster iteration as it is well supported on both hardware and language/tool/framework levels. As you develop your application and you gain more experience and insight into what is actually required, you could then consider switching protocols if you so deem.