title: Best method for updating all MySQL data
body: <p>I am working on a project where everyday a csv file with information needs to be processed into a MySQL table (I am creating an AWS Lambda to read the data from the S3 bucket it is sent to each day). I am trying to think of the best way to handle this data. If there are changes to an existing row, I will need to update said row. But if there is a new item, it will need to be added. Or, if an item is no longer on the csv file, it will need to be removed from the table. Regardless, the data coming in on the csv file will always be the up to date information that needs to be in the database. Would it make sense to delete all the existing rows each time the data processes and just insert the up to date data? Or would it be smarter to go through each of the csv rows and check if there is a matching row that needs to be updated/a new row that needs to be added in the table? I would also have to then go through each row in the table and check if there are any rows that need deleted (items that were not included in the csv file).</p>
  <p>I am really just hoping for some insight and opinions on how best to handle this data. It is an odd scenario.</p>