title: Using Firebird Trace and Audit service for database replication
body: <p>Firebird supports <a href="https://www.ibexpert.net/ibe/pmwiki.php?n=Doc.TraceAndAudit" rel="nofollow noreferrer">Trace and Audit</a> service since version 2.5.</p>
  
  <p>Audit logs may configure to filter SQL statements that is useful for database replication.</p>
  
  <p>Here is a sample log:</p>
  
  <pre><code>INSERT INTO RDB$BACKUP_HISTORY(RDB$BACKUP_ID, RDB$TIMESTAMP, RDB$BACKUP_LEVEL, RDB$GUID, RDB$SCN, RDB$FILE_NAME) VALUES(NULL, 'NOW', ?, ?, ?, ?)
  
  param0 = integer, "0"
  param1 = varchar(38), "{855507A3-C794-477C-7E8E-BF5381BB6132}"
  param2 = integer, "39"
  param3 = varchar(255), "r:\backup.nbk"
  </code></pre>
  
  <p>If we do a program to parse the committed <code>INSERT</code>, <code>UPDATE</code> and <code>DELETE</code> statements from log and replay these SQL statement on replicated database, it seems we can produce some kind replication strategy here.</p>
  
  <p>However, I can't find any discussions using trace and audit service on database replication.  Is it advisable to do so?</p>