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

lubien
Several weeks ago I was nerd snipped by browsers support for View Transitions API and took to myself to see how that goes in LiveView. Af...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
aseigo
ICal is a library for interacting with iCalendar data. It parses iCalendars into typed Elixir structs via ICal.from_ics, and can prepare ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews