Jaypee

Jaypee

Secure files transfers servers in Elixir?

Dear Elixir Community,

First, I hope I choosed the right thread to post…

After Clojure last year, I’m currently studiying Elixir.
I’ve read several books, seen tons of videos and also struggled with some exercices on Exercism/Elixir ( a bit less “beginners friendly” than its Clojure counterpart “4Clojure” !).

It happens that the advantages of Elixir/OTP could benefit to the project I’m working on at the moment, so I would like to do some tests/benchmarks on some basics componants of this project:

I want to implement small servers in Elixir, that could be located on several computers/VM which simply send and receive files and could also verify their integrity (MD5 checksum ?)

The benchmark will mainly focus on scalability (multiply the servers and test a lot of simultaneaous file transfers) and robustness (test the transfer of huge files between two servers).

At the moment, I must confess that I’m a bit confused with the Elixir/OTP Genservers, Supervisors, Workers and others and how to correctly articulate them.
So I would like to have some advices/suggestions/hints on the correct way to use and organise these entities in order to implement the most efficient file transfer server in Elixir, regarding the goals of the benchmark.

I’m also open to suggestions concerning tips and tricks I could use to optimize my FT servers.

To my knowledge, Elixir is not used in my (big) company and I’d really like to succeed in providing a “proof of concept” ! :wink:

Best regards and thanks in advance for your help.

P.S.: Please forgive my English as long as you roughly understand what I write !

Marked As Solved

Jaypee

Jaypee

I redevelopped an entire new application (“Simple SFTP Client Server in Elixir”), based on things I learned this year:

Here’s the SscsEx GitHub page

NB: You can only use this repository as an inspiration for your own code as SscsEx will NOT be updated: I’m now on my way to the next Elixir step: learning Phoenix + LiveView ! :wink:

Also Liked

joeerl

joeerl

Creator of Erlang - Fondly Remembered

Well you have sockets, and something to compute an MD5 checksum - which is actually all you need.

Forget all the generic this and that and make a simple socket client and server (homework - find out the smallest socket client and server code)

Making a client/server over a socket is virtually the first thing I do in any language when learning - very instructive

Repeat in C, TCL, JS, Java, Ruby, Python, Perl, C#

Seriously, the round trip client → server → client with a check that you transfer all data and loose nothing is an essential programming technique - learn to do this first THEN add JSON/XML (whatever) on top.

Once you can get two programs in different languages communicating raw bytes over a socket then you can start having fun - Use the low level socket libraries and NOT fancy frameworks - this is the slow way to program - BUT in the long term the best way - understanding is the key to programming libraries which hide what you are really doing should only be used once you understand what’s really happening

Cheers

joeerl

joeerl

Creator of Erlang - Fondly Remembered

Well a while back I wanted to transfer some files so …

:slight_smile:

AstonJ

AstonJ

What is your experience on which you base such comments?

As shown in the benchmarks by @brightball any performance hit by Phoenix for the majority of apps would generally be considered to be negligible.

Last Post!

Jaypee

Jaypee

Some updates:

I have been working on my corporate app (not the SscsEx on Github) SFTP Server/Client using streaming, integrity checking and retries on error.

Inspired by the “Real-Tme Phoenix” book, I had the idea to create a Phoenix app to monitor in real-time my SFTP Client/servers with no or at least minimal database accesses
It uses Phoenix + LiveView + Bulma CSS + Surface in order to completely avoid JS. I only have a small DETS database to store the basics informations about my servers (no Ecto) grabbing the rest in real time, with Phoenix Channels.

I only added a new communication layer on my SFTP Servers/Clients using the PhoenixClient library and made minimal refactories.

At the moment it’s on a very crude state but it works !

Where Next?

Popular in Questions Top

hariharasudhan94
I would like to know what is the best IDE for elixir development?
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
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
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
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
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
hariharasudhan94
I would like to know what is the best IDE for elixir development?
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 31586 112
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New

We're in Beta

About us Mission Statement