title: Local database replication from multiple devices to a single external database
body: <p>I have a bunch of devices that process images from cameras. Many cameras can be connected to a single device. Device has an unique serial number.</p>
  
  <p>Each image is stored on local filesystem and associated metadata is written to local database (with path to the file).</p>
  
  <p>I'd like to move data from the device to external server. This means that files are moved to media server and new rows from database are moved to the external database.
  That external database should aggregate data from many local ones.
  I'd like also to synchronize both replication, this means that I don't want a new row to appear in the external database before file is accessible on media server.</p>
  
  <p>Are there any solutions that allows for such synchronized replication or do I need to write some service that will do that?</p>
  
  <p>I am open to suggestions on file transfer protocol, but database is created in MySQL.</p>