From zero to Production Elixir in 1 month
medium.com
medium.com
1) Client-side app receives an image (via drag-and-drop or file picker)
2) Client hits an authenticated endpoint on backend with the name of the file, which returns a “signed URL” (authenticated, with customizable expiration) from Google Cloud Storage
3) (This part is particular to GCS, and I think unneeded for AWS/S3) Hit this signed URL in the client, and receive a final, PUT-able URL
4) Upload the file using the final authenticated URL from Google Cloud Storage
Like I said, I think with AWS/S3 you can just request a signed URL and send data to that URL directly. Delegating as much communication with GCS to the backend was important for my project [1] but you might be able to just manage it with a JS lib.
[1] Streaming music, so trying to abstract the actual files from the client-side as much as possible to discourage downloading the raw audio files
However, you can also create a Lambda that is triggered whenever a file is uploaded to a given bucket and directory. With this, you can react to the file being received and update your database without the need for a second request.
1. http://bencoe.tumblr.com/post/30685403088/browser-side-amazo...
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.
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.
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.