aseigo

aseigo

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!

Showing Posts 1 to 10

petersonfs

petersonfs

@kelvinst get a look :slight_smile:

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!

aseigo

aseigo OP

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!

kelvinst

kelvinst

It happens with everyone, more than it should, but that’s the way it is. :lol:

You’re welcome!

aseigo

aseigo OP

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?

kelvinst

kelvinst

Sure! Any suggestion?

kelvinst

kelvinst

I’ve opened this PR with a new description, what do you think?

https://github.com/ateliware/triplex/pull/39

aseigo

aseigo OP

Perhaps something like:

“A simple and effective way to build multitenant applications on top of Ecto. Keep data specific to each tenant (group of users) separate in the database using standard Ecto functions. Triplex includes mix tasks as well as a simple tenant management API to simplify defining and managing tenants.”

?

kelvinst

kelvinst

Looks great! It’s good to have native english speakers that are willing to help! Thanks!

praveenperera

praveenperera

@kelvinst Also adding some more topics on the github repo might help as well. Maybe “multitenant” , "SaaS, “apartment”.

Where Next? Top

Trending in Screencasts Top

Other Trending Topics Top

KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews