title: Spring Data/JPA Repositories with DynamoDB and MySQL dual datasources
body: <p>I'm familiar with how to make Spring handle multiple datasources dynamically via multiple persistence-units and multiple entityManagerFactoryBean implementations but what I'm struggling with is how to have a MySQL dialect <em>and</em> a DynamoDB dialect from within the same spring configuration, via spring-config xml files.</p>
  <p>The work pattern is as follows:</p>
  <p>[data POJO in, from some endpoint] -&gt; Persist POJO into DynamoDB, retrieving the UUID of that object (business key as field on POJO) -&gt; Persist UUID as a compound key (no referential integrity, it's just another column) into MySQL Database [with other related mapped entities].</p>
  <p>I'm struggling with quite how on earth to go about adding the DynamoDB instance into the Spring configuration files to achieve this.</p>
  <p>For what it's worth, the related repositories are going to be in separate packages.</p>
  <p>Any starters for 10 would be gratefully received!  I've done some searching but all DynamoDB mapper frameworks seem to be at a much higher level - have I missed something here?  I've been looking at <a href="https://github.com/michaellavelle/spring-data-dynamodb" rel="noreferrer">Spring-Data DynamoDB</a> but still can't make the link between the configuration file and Dynamo.</p>
  <p>Thanks in advance,</p>
  <p>A.</p>
  <p>========= UPDATE IN THINKING =========</p>
  <p>I think I've gone about this the wrong way.  From digging around the samples a lot more, doing a local integration test [pure dynamodb], I don't think it's possible to use DynamoDB as part of an EntityManager Factory implementation: to that end, I think I'm going to have to &quot;create&quot; my own repository implementations that call out to the mapper and AWS connection helper classes etc. for Dynamo, rather than using any of the JPA spring-provided code.</p>
  <p>Unless anyone can recommend/suggest otherwise?</p>