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 - Perhap: Applying Domain Driven Design and Reactive Architectures to Functional Programming - by @Version2beta ...
New
axelson
ElixirConf 2017 - Keep an Eye on the Sky with Nerves and Phoenix - @electricshaman As part of the next gener...
New
CodeSync
Hologram Building Rich UIs with Elixir Running in the Browser - Bart Blast | ElixirConf EU 2025 Comments welcome! View th...
New
axelson
ElixirConf 2017 - Embedded Elixir for Monitoring the Built Environment - Christopher Coté At CRT Labs (Natio...
New
AstonJ
Keywords: LiveView autocomplete, LiveView search, focus Startups and web developers take note. Phoenix LiveView is the revolutionary fr...
New
New
New
TwistingTwists
I am in middle of watching this. I have to stop every minute and think over what Chris just said. The amount of info he sends over that ...
New
axelson
ElixirConf US 2018 – Simple is Beautiful: Building an SLA Monitoring Tool Using Elixir/OTP at PagerDuty – Aish Dahal ...
New
axelson
Okay, posting this day’s talk by @boydm: ElixirConf 2017 - Elixir Native UI - Boyd Multerer I will be show...
New

Other popular topics Top

Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31142 143
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36128 110
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New

We're in Beta

About us Mission Statement