title: Microservices db design issues
body: <p>I've just started separating my projects out into little microservices. I have a microservice which deals with API authorization (checks if an apiKey provided in an API request is valid) and so for this, I have a separate DB for the API Authorization which has the following tables with the following schema:</p>
  
  <p>APIKey:
  ApiKey (VARCHAR, PK)
  TenantID (INT, FK)</p>
  
  <p>Tenant:
  TenantID (INT, PK)
  Name (VARCHAR)</p>
  
  <p>As you can see the APIKey table is linked to the Tenant table.</p>
  
  <p>I have another microservice, this microservice deals with storing errors for tenants and so requires reference to the tenant table, but because the Tenant table is in a separate DB, we can't actually use it. </p>
  
  <p>I thought about creating a Tenant service and having a DB just for Tenants but this would cause data integrity issues on other microservices which require some reference to a Tenant so I'm not sure what I should do.</p>
  
  <p>Can anyone suggest what should be done?</p>