title: Comparing databases in different formats
body: <p>We have two databases storing similar data in different formats. The first stores data used by us (A) in format convenient for usage, the second stores data provided for us (B) in format convenient for export by another party. We also have a service which receives notifications about changes in B and updates A accordingly. </p>
  
  <p>Now we want to write a validation tool to compare these databases.
  The basic idea is:<br>
  1) Get all Foo ids in A, get all Foo ids in B<br>
  2) Compare ids, write unique to report and send common for comparison.<br>
  3) Retrieve top level objects (differently) and compare their own fields, then if these fields are equal retrieve related objects (it may be links to another tables or some extra fields in A and link to another object in B or vice versa) and compare these additional data. Send differences to report.<br>
  4) Repeat with next type of entity.</p>
  
  <p>What are typical approaches for above task? The amount of data is relatively big (can't fit all data in memory) and performance is one of the main requirements</p>
  
  <p>I'm tagging this as "java" because the tool will be written in it and some of the frameworks suitable for this will be really appreciated.</p>