title: Is it okay to have more than one repository for an aggregate in DDD?
body: <p>I've read <a href="https://stackoverflow.com/questions/48581756/different-persistence-repositories-for-an-aggregate-in-ddd">this question about something similar</a> but it didn't quite solve my problem.</p>
  
  <p>I have an application where I'm required to use data from an API. Problem is there are performance and technical limitations to doing this. The performance limitations are obvious. The technical limitations lie in the fact that the API does not support some of the more granular queries I need to make.</p>
  
  <p>I decided to use MySQL as a queryable cache.</p>
  
  <p>Since the data I needed to retrieve from the API did not change very often, I settled on refreshing the cache once a day, so I didn't need any complicated mapper that checked if we had the data in the cache and if not fell back to the API. That was my first design, but I realized that wasn't very practical when the API couldn't support most of the queries I needed to make anyway.</p>
  
  <p>Now I have a set of two mappers for every aggregate. One for MySQL and one for the API.</p>
  
  <p>My problem is now how I hide the complexities of persistence from the domain, and the fact that it seems that I need multiple repositories.</p>
  
  <p>Ideally I would have an interface that both mappers adhered to, but as previously disclosed that's not possible. </p>
  
  <p>Is it okay to have multiple repositories, one for each mapper?</p>