Iex.new

Iex.new

From PHP to Elixir?

Hello!,

I just started this week to discover Elixir.
I’m a PHP-Programmer and did some sutff in Go too.
The more I read about Elixir the more I’m intressting and exited about the possibilites that offert this language and it’s libraries (Phoenix, Oban, Ecto … ).

I use a Cli-App in php to import data and for each rows I do some operations on it.
A Job-Scheduler is also used to start this app regularly.

I’m thinking about to write the app in Elixir. Does Elexir feet well for my use case or this use case is more a for Go?
I have 60.000 / Job executions per days which are started by a Scheduler.

Thank you!

Most Liked

dimitarvp

dimitarvp

60k per day is nothing. I import 1 million records in about ~18 seconds with my Elixir tools. Although I don’t know how much a single task would take in your case.

Elixir per se is not the ideal candidate for CLI tools because the VM starts up slower compared to dedicated statically compiled languages like Go and Rust. But it still works quite fast.

What’s your expected usage of Elixir? A background jobs processor?

entone

entone

FYI, Elixir/Erlang provides a remote shell with some extremely powerful inspection tools across your whole application. So you may be able to get rid of your CLI tools, and just use the built-in remote shell.

Specifically Fred’s tool https://github.com/ferd/recon is pretty great.

And his book Erlang in Anger is worth a read as well.

kokolegorille

kokolegorille

You have a console with Elixir, when You run in a project

$ iex -S mix

You have direct access to your application, and You can debug, recompile in it… It would be like Linux for application, You don’t need to reboot, You just recompile.

Elixir is a language that simplify concurrency, it’s built in.

Nothing stop You to start 60 000 processes, each one responsible for a job.

60_000 is not a high number for processes, but You need to master how to manage them.

OTP is done for this, it’s all about managing correctly processes. You did not mention it, You just mentionned libraries. But it’s included in the BEAM.

If You come from PHP, You will be surprised at the dev tooling offered by Elixir :slight_smile:

You can build script with Elixir.

cmkarlsson

cmkarlsson

I knew the ssh server was there but I had never tried it. It was surprisingly easy to setup and gets you straight into the node. I wonder if I should just add that in as a standard for my releases from now on.

Iex.new

Iex.new

Thank you for your answer,

60K was the number of job exeuctions / days ) it could be the same or a diffrent).
Execution could be an import/export or an update (Flows)
A Cli-App is helpfull to check on the output during development process the result of the exeuction.
It give also the flexibility to set some parameter and see (into a scheduler sofware) quickly how the application was started.

How Elixir Applications are started ? Are they started once and run “forever” ?
Does your application look into a specific directory that a file has to be proceed ?

I often deploy a new “version” of the cli-application, that may have correction,improvment ot extension of a buisness logic

I think an usage of Elixir as a background job processor is the way that is close to what I use now.

Where Next?

Popular in Chat/Questions Top

shansiddiqui94
Hello all, I recently did my first app in Phoenix and Liveview, many thanks to all the users who assisted me. I found that the tutorial ...
New
RKC07
I’m new to elixir. I did some coding in python and C. I want to learn elixir for starting my career in web development. I need suggestion...
New
New
svetarosemond
I’m planning on purchasing Elixir in action second edition, and I was wondering if anyone could tell me based off the first edition, does...
New
zervis
Hello, I’m about to dive into web development. I was thinking about Laravel or Ruby on Rails, but then I found Phoenix. Do you recommen...
New
wallyfoo
Long story short, I have a real world need to create a view for hooking up a shipping terminal to live data, but because of some early ar...
New
Nvim
Anybody know of a Pragmatic Studio 40% off coupon code for video course like Phoenix?
New
lgmfred
Hello, I want to get started with elixir today. Having learnt the basics of Erlang (my first ever language) and seen what it’s can do, I’...
New
QueenSvetlana
My bookstore has Introducing Elixir: Getting Started In Functional Programming and the front cover says the book uses Elixir 1.4. The cur...
New
Fl4m3Ph03n1x
Background Hey guys, recently I bought a book on TDD that I am reading. The books is really nice and has some really juicy things on arch...
New

Other popular topics Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
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 30048 115
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
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
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
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

We're in Beta

About us Mission Statement