<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="91031" data-post-id="91031">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="chanon" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/chanon/120/13215_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  chanon
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This looks like an awesome library and is exactly what I need. I do have some questions:</p>
<ul>
<li>
<p>Does anyone have actual production experience with using separate schemas in PostgresQL for multi-tenancy in a SaaS application (either using Triplex or not)? Have you found that this approach scales well or not eg. for thousands or tens of thousands of tenants or more? (Both in terms of performance and ease of maintenance.)</p>
</li>
<li>
<p>Triplex looks like it will neatly solve the multi-tenancy part of the problem. However, what about sharding to multiple PostgresQL physical server instances to distribute load? How would one go about that together with using Triplex?</p>
</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="91031" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/triplex-a-complete-solution-to-multi-tenancy-with-pg-schemas/7747/32">Post #31</a>
	                </div>
	            </div>
              <div id="likers-container-91031" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="91031"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #31"></div>
  </section>
</div>
    <div class="postbit" id="91141" data-post-id="91141">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kelvinst" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kelvinst/120/10173_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kelvinst
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hey <a class="mention" href="/u/chanon" rel="nofollow">@chanon</a> thanks for all the <img src="https://forum.elixirforum.com/images/emoji/apple/purple_heart.png?v=15" title=":purple_heart:" class="emoji" alt=":purple_heart:" loading="lazy" width="20" height="20">!</p>
<p>So here it goes:</p>
<aside class="quote no-group" data-username="chanon" data-post="32" data-topic="7747">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/chanon/48/13215_2.png" class="avatar"> chanon:</div>
<blockquote>
<ul>
<li>Does anyone have actual production experience with using separate schemas in PostgresQL for multi-tenancy in a SaaS application (either using Triplex or not)? Have you found that this approach scales well or not eg. for thousands or tens of thousands of tenants or more? (Both in terms of performance and ease of maintenance.)</li>
</ul>
</blockquote>
</aside>
<p>Yes, we used it, but didn’t found too many problems, except for some bad stuff we did on migrations (but was our fault). But the creators of apartment (the same lib in ruby world) found some problems with a big database: <a href="https://influitive.io/our-multi-tenancy-journey-with-postgres-schemas-and-apartment-6ecda151a21f" rel="noopener nofollow ugc">here are their thoughts</a>, and we discussed about it <a href="https://forum.elixirforum.com/t/triplex-a-complete-solution-to-multi-tenancy-with-pg-schemas/7747/9" rel="nofollow">here in this topic</a>.</p>
<aside class="quote no-group" data-username="chanon" data-post="32" data-topic="7747">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/chanon/48/13215_2.png" class="avatar"> chanon:</div>
<blockquote>
<ul>
<li>Triplex looks like it will neatly solve the multi-tenancy part of the problem. However, what about sharding to multiple PostgresQL physical server instances to distribute load? How would one go about that together with using Triplex?</li>
</ul>
</blockquote>
</aside>
<p>I personally don’t have any kind of experience with this yet. Would love to see some other people here sharing their thoughts!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="91141" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/triplex-a-complete-solution-to-multi-tenancy-with-pg-schemas/7747/33">Post #32</a>
	                </div>
	            </div>
              <div id="likers-container-91141" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="91141"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #32"></div>
  </section>
</div>
    <div class="postbit" id="91164" data-post-id="91164">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="chanon" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/chanon/120/13215_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  chanon
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/kelvinst" rel="nofollow">@kelvinst</a> Thanks for the answers! I’m going to go ahead and try using Triplex.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="91164" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/triplex-a-complete-solution-to-multi-tenancy-with-pg-schemas/7747/34">Post #33</a>
	                </div>
	            </div>
              <div id="likers-container-91164" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="91164"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #33"></div>
  </section>
</div>
    <div class="postbit" id="118429" data-post-id="118429">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kelvinst" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kelvinst/120/10173_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kelvinst
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m here to announce the long awaited new version for Triplex!</p>
<p>Actually, it’s an RC for the new version. You know, we need to test it well before releasing it out in the wild.</p>
<p>Anyways, this version will come with the support for two new things: <strong>Ecto 3 and MySQL</strong>!</p>
<p>The details are here in the release notice: <a href="https://github.com/ateliware/triplex/releases/tag/v1.3.0-rc.0" class="inline-onebox" rel="noopener nofollow ugc">Release 1.3.0-rc.0 · ateliware/triplex · GitHub</a></p>
<p>Also, refer to the release notice for how to upgrade, since there are some breaking changes on Ecto 3 migrations that affected <code>Triplex.create</code> inside <code>Repo.transaction</code>s.</p>
<p>With no further ado, we would be very grateful if you could test it out on your projects and let us know with github issues if any problem occurs!</p>
<p>Thank you all!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="118429" data-batch-url="/posts/batch_likers">
                        7
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/triplex-a-complete-solution-to-multi-tenancy-with-pg-schemas/7747/35">Post #34</a>
	                </div>
	            </div>
              <div id="likers-container-118429" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="118429"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #34"></div>
  </section>
</div>
    <div class="postbit" id="118991" data-post-id="118991">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kelvinst" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kelvinst/120/10173_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kelvinst
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>We just released a new release candidate <code>1.3.0-rc.1</code> because there was a bug that would happen for everyone that is not using both MySQL and Postgres, so pretty much everyone. Please update to get the fix. Thanks!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="118991" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/triplex-a-complete-solution-to-multi-tenancy-with-pg-schemas/7747/36">Post #35</a>
	                </div>
	            </div>
              <div id="likers-container-118991" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="118991"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #35"></div>
  </section>
</div>
    <div class="postbit" id="130507" data-post-id="130507">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kelvinst" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kelvinst/120/10173_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kelvinst
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Heeey! Long time no see, but I’m here to announce <code>1.3.0</code> (not rc, the official one) is out! You can check the list of stuff on the <a href="https://github.com/ateliware/triplex/releases/tag/v1.3.0-rc.0" rel="noopener nofollow ugc">release notice</a>, but for those that have no time, the big thing on this release was the <strong>support to Ecto 3</strong>.</p>
<p>Hope that the lib is still useful for all of you and we are always open to contributions, but please do not be sad if we take some time to answer, there are not too many people on the core team for it and we are very busy lately.</p>
<p>Thanks!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="130507" data-batch-url="/posts/batch_likers">
                        10
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/triplex-a-complete-solution-to-multi-tenancy-with-pg-schemas/7747/37">Post #36</a>
	                </div>
	            </div>
              <div id="likers-container-130507" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="130507"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #36"></div>
  </section>
</div>
    <div class="postbit" id="136590" data-post-id="136590">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mchean" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mchean/120/6820_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mchean
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I was just wondering if this works with Absinthe?  I’m thinking of using Mysql as well.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="136590" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/triplex-a-complete-solution-to-multi-tenancy-with-pg-schemas/7747/38">Post #37</a>
	                </div>
	            </div>
              <div id="likers-container-136590" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="136590"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #37"></div>
  </section>
</div>
    <div class="postbit" id="136658" data-post-id="136658">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mgiacomini" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mgiacomini/120/11389_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mgiacomini
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Why wouldn’t work? Inside your resolver just use the <em>prefix</em> option as usual :). With dataloader you can use this:<br>
<code>Dataloader.Ecto.new(MyApp.Repo, repo_opts: [prefix: Triplex.to_prefix("some-tenant")])</code></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="136658" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/triplex-a-complete-solution-to-multi-tenancy-with-pg-schemas/7747/39">Post #38</a>
	                </div>
	            </div>
              <div id="likers-container-136658" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="136658"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #38"></div>
  </section>
</div>
    <div class="postbit" id="136691" data-post-id="136691">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mchean" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mchean/120/6820_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mchean
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>No reason it wouldn’t work.  I’m just beginning so I wanted to make sure.  Thank you!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="136691" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/triplex-a-complete-solution-to-multi-tenancy-with-pg-schemas/7747/40">Post #39</a>
	                </div>
	            </div>
              <div id="likers-container-136691" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="136691"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #39"></div>
  </section>
</div>
    <div class="postbit" id="148014" data-post-id="148014">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zimt28" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zimt28/120/9933_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zimt28
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Is it possible to reference a table, say <code>clients</code> where the prefix is dynamic? Now when referencing it I could only find a way to create cross schema references when the prefix is known. The only way I see now is storing the <code>client_id</code> and <code>client_prefix</code> in two fields, but this seems a bit against the idea of a relational db.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="148014" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/triplex-a-complete-solution-to-multi-tenancy-with-pg-schemas/7747/41">Post #40</a>
	                </div>
	            </div>
              <div id="likers-container-148014" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="148014"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #40"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/7747/load_more?page=5">Load more posts (3 remaining)</a>
</div></template></turbo-stream>