How do you ensure data integrity when integrating legacy databases with modern software applications?