aseigo

aseigo

Explor Elixir E6: Multitenant Apps with Ecto and Triplex

I am finally back with another episode of Exploring Elixir. Sorry for the long wait! My August was split between vacation and starting a new adventure at work, so EE got punted for the month. Back to weekly episodes now though …

In episode 6, we look at using Ecto and Triplex to create multitenant applications. Even for those who have used these tools before, there may be a couple tips in there for you yet, such as how to get the prefix to use from inside a Triplex migration …

Hope you enjoy, as always!

Most Liked

kelvinst

kelvinst

Triplex author here! Really glad to see you enjoyed it to the point of making a video using it!

Your video is really awesome! It has a really nice overview for who wonders what does it do.

I was working on an article/tutorial of how to use it (@BarelyFunctional asked for it), but got no time to finish it yet! I promise I’ll work on it soon…

About the use of prefixes on migrations, that’s a nice catch. I actually had this problem but forgot to document my solution. Just a little thing you probably missed: there is a function that gets the prefix of the running migration for you - Ecto.Migration.prefix/0. It does exactly what you do, but without that much work! :wink:

Thanks @aseigo for all your work!

kelvinst

kelvinst

Added! Thanks for the suggestion!

petersonfs

petersonfs

@kelvinst get a look :slight_smile:

aseigo

aseigo

Dang, I completely missed that somehow. Been there since 2.0 as well! Will update the repo later to simplify with this … thanks, both for this tip but also the library!

aseigo

aseigo

BTW … it is quite difficult to find triplex on hex.pm. It does not mention the magic term “multitenant” or “multitenancy” anywhere in the description, which is probably what many people search for (one such person already popped up in the comments on Reddit, in fact).

hex.pm mangles the markdown in the README.md description which doesn’t help any either. Even then, as someone who did not come to Elixir from Ruby, the reference and link to Apartment didn’t really help me find it, either.

You may wish to consider tweaking the descriptions on github and especially hex.pm to make it more discoverable?

Where Next?

Popular in Screencasts Top

New
ElixirCasts
I made an episode where we implement passwordless authentication with the Veil library. You can watch it here: https://elixircasts.io/pa...
New
New
AlchemistCamp
https://alchemist.camp/episodes/word-count I’ve just made a new version of of Lesson 2 from Alchemist Camp. It has significantly larger ...
New
ElixirCasts
I made an episode for anyone wanting an introduction to testing with Elixir. https://elixircasts.io/introduction-to-testing
New
snake117
I came across ElixirCasts.io, a free, high quality screencast showing various subjects in Elixir and Phoenix. I didn't see it posted on t...
New
New
aseigo
Elixir1.5.0-rc0 and OTP 20 are significant releases, full of features, bug fixes and optimizations. I was really curious as to how the op...
New
AstonJ
Nice to see another thing on my wish-list come true :003: I haven’t had a chance to watch this yet but I am sure it is very good! ...
New
zacksiri
At Codemy.net we are always trying to find solutions for problems in a way that works well. As a result we’ve been able to create a beaut...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
326 29600 154
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
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

We're in Beta

About us Mission Statement