smanza

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

Showing Posts 1 to 5

hauleth

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

smanza OP

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

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

smanza OP

In fact I’m using always :safe in :erlang.binary_to_term and 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

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.

— All posts loaded —

Where Next? Top

Trending in Discussions Top

AstonJ
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...
2977 91898 914
New
AstonJ
The obligatory hello world thread! Who are you and where are you from? :stuck_out_tongue:
4616 55835 594
New
byu
@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project. My initial shotgu...
New
arcanemachine
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
alexslade
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
Herve37
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
matt-savvy
Is there a word for the ~> symbol used in Version strings? Do you also just call it a Squiggle Arrow™ ?!
New

Other Trending Topics Top

JesseHerrick
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
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Damirados
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
ausimian
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

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews