title: Multi tenancy design - sharing data between schemas
body: <p>Let's consider such case:</p>
  
  <ol>
  <li>User can have a company (or many of them)</li>
  <li>User can be a part of a company (or in many of them)</li>
  <li>Company is a single tenant of the system</li>
  <li>Company has a list of tasks</li>
  <li>Each task is assigned to a user</li>
  </ol>
  
  <p>Now given the circumnstaces above, I want to implement a system in which each company (tenant) has a separate schema for its tasks, but the problem is that for each task I also need a user data from the main schema.</p>
  
  <p>The question is how to approach this problem</p>
  
  <p>The possible solutions I have thought of (but none is really convincing me):</p>
  
  <ol>
  <li>Copying all users data matched with a company to company's schema (it would require a fair amount of synchronization, therefore I don't find it very efficient)</li>
  <li>Switching between schemas and 'merging' them programmatically - this one involves a lot of additional code to implement and it violates good practices - as the user_id in task would reach outside the tanant's schema)</li>
  </ol>
  
  <p>I hope there is a better solution I haven't thought of. Please note that this is a simplified case, just to describe the problem.</p>