zporter

zporter

40) ElixirConf US 2018 – Breaking Down the User Monolith – Zach Porter

ElixirConf US 2018 – Breaking Down the User Monolith – Zach Porter

Coming from Ruby on Rails, the convention is to have a User model handle multiple aspects of an account such as login, logout, password reset, and email confirmation. While there is a temptation to bring that convention with us when building an Elixir application, we can do better by leveraging bounded contexts, Ecto’s embedded schemas, and Ecto.Multi to break these separate pieces of functionality into isolated chunks that are easier to maintain and extend.

Audience: Beginner, Intermediate

All talks are available in the ElixirConf US 2018 Talks List or via the elixirconf2018 tag

Most Liked

zporter

zporter

Hey! Thanks for your interest in my talk!

Quick answers to your questions:

So, for that reason I’ll ask, if somebody have a github repo of this talk.

Not yet, but I am planning on finishing one that I started to accompany this talk. I can post here when it’s ready.

The trouble that I have is with the embedded_schema. Because I was watching the video and it’s seems to be incomplete, he don’t explain how to declare the structure for the user schema, using something like embedded_one and also he don’t show how can we create the migrations for that embedded field.

The example I gave using embedded_schemas was around Registrations. I apologize if it wasn’t clear, but I’m not actually persisting that embedded schema to the database. I’m using it to provide structure to a form or a set of user inputs and to manage changes and validations for those inputs. I’m then relying on the existing User schema as well as the Credential schema to persist to the relevant tables in the database. I hope that helps to clear the example up some! The embeds_one and embeds_many functions are very useful for storing in a JSON column in the database, and I’ve certainly done that before, but not in this case.

If you have any further questions, please let me know.

Thanks!

Yamilquery

Yamilquery

Hi guys! First of all, thank you so much for this ElixirConf 2018, was really awesome!

I was watching the ElixirConf 2018, specifically a video “ElixirConf 2018 – Breaking Down the User Monolith – Zach Porter”, in which he explains how to breaking down the User monolith. But I had a couple of doubts with it, and it seems to they disable the comments section in Youtube.
So, for that reason I’ll ask, if somebody have a github repo of this talk.

I was trying to replicate the exposed approach, but I got some errors.

The trouble that I have is with the embedded_schema. Because I was watching the video and it’s seems to be incomplete, he don’t explain how to declare the structure for the user schema, using something like embedded_one and also he don’t show how can we create the migrations for that embedded field.

I found a tutorial to do that thing, but I’m not pretty sure if it’s the best practices.

https://robots.thoughtbot.com/embedding-elixir-structs-in-ecto-models

Thank you so much!

Where Next?

Popular in Talks Top

axelson
ElixirConf 2017 - Building Realtime Mobile Apps with React Native and Elixir - Osayame Gaius Obaseki Buildin...
New
New
axelson
ElixirConf 2017 - HTTP 2 Plug to Phoenix Cowboy too - @Gazler In this talk, we will look at the changes in C...
New
ElixirConf
ElixirConf: ElixirConf 2023 - Tim Gremore - Replacing React: How Liveview solved our performance problems Comments welcome! View the <sp...
New
axelson
ElixirConf 2018 – Day 2 Opening Keynote – Justin Schneck (@mobileoverlord) All talks thread:
New
rodrigues
Whether you’re developing a small web site or a large-scale distributed system, Erlang and Elixir are great tools for building server-sid...
New
CodeSync
Code Sync: Vaxine, the Rich CRDT Database for ElixirPhoenix Apps | James Arthur | Code BEAM America 2022 Comments welcome! View the <spa...
New
axelson
ElixirConf 2017 - Writing an Editor in Elixir - by @ijcd (Ian Duggan) Elixir for GUIs? Yes, it’s possible. I...
New
LostKobrakai
After having watched the talk I’m wondering if this would also be a good opportunity to gather examples / tips about how to prevent or mi...
New
axelson
ElixirConf US 2018 – Closing Keynote – Chris McCord (@chrismccord) All talks thread:
New

Other popular topics Top

siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
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
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39467 209
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
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" =&gt; #BSON.ObjectId&lt;58eb1a7a9ad169198c3dXXXX&gt;, "email" =&gt; ...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement