
From zero to Production Elixir in 1 month - myth_drannon
https://medium.com/onfido-tech/from-zero-to-production-elixir-in-1-month-1-2-a9d051191ad7
======
hartator
The author seems to be unaware of being able to upload directly to S3 via JS
eliminating the need of even the Phoenix app.

~~~
blatyo
I'm not sure if it's a recent feature, but I was unaware of it until recently.
However, you'd still need an app to sign the upload URL. Otherwise, you'd have
to expose the AWS secret key to the client.

~~~
schainks
It's mostly a matter of setting up an endpoint in your app to sign manifests
using the secret key. It's give or take a dozen lines of code on the backend
(to do it in an "unsophisticated way"), and was one of the first things I
wrote in Elixir! These two links should get you on your way:

1\. [http://bencoe.tumblr.com/post/30685403088/browser-side-
amazo...](http://bencoe.tumblr.com/post/30685403088/browser-side-
amazon-s3-uploads-using-cors)

2\.
[https://aws.amazon.com/articles/1434/?tag=vig-20](https://aws.amazon.com/articles/1434/?tag=vig-20)

------
colbyh
as much as I love Elixir (and Erlang/BEAM) I get uncomfortable when people say
"I heard it was a magic bullet for scalability and concurrency[...]. the
language provides primitives that can, in certain circumstances, make it
easier to scale horizontally, but there's no magic. and there are certainly
tradeoffs (esp with regards to managing state) that can actually make your
code harder to scale.

dig the post, just an observation. for anyone new to the language reading this
please understand that Elixir isn't a super fast/concurrent Ruby replacement.
but it is a hell of a lot of fun to program in.

~~~
weego
I feel like scala went through the same thing with akka, just with less blog
hype. It's a panacea until someone asks how you manage state.

------
ramchip
This feels like a bit... too much. If you’re really going for microservices,
that means every service will be small and specialized. Do you really need to
split it further into so many sub-apps? I feel like the S3 app is going to end
up as one module with a handful of functions.

~~~
rothbardrand
These are medium sized. Remember in elixir it's perfectly convenient to map
across a list by spawning a process for each element in the list and sending
the function you want to map to that process, and then they collapse down and
get reduced.

A process (or application) in elixir is no big deal, just think of it as a
module or object that lives in its own process, probably has a set of
processes and all that...

If you were writing this in go you might call it a monolith because all of
those "Apps" would be in one single binary executable.

~~~
ramchip
My comment is about code organization, not process usage. You can have 6
separate apps and still do everything in a single process.

By splitting into lots of sub-apps, you end up with a deep folder structure
like `my_service/apps/s3/lib/s3/query.ex`, each app having its own versioning,
configuration, tests, etc. That makes sense for a sizable codebase, but for a
microservice, I don't think the added complexity is worth the benefit. It can
be organized very cleanly with just modules and folders.

------
pmontra
Code?

