@allenyang I have a suggestion.
Every time there is an error with data on a row, the upload stops.
My suggestion would be to implement the option of allowing to skip those rows with issues and upload the rest of the data.
Then, the user would have the option to fix the issues with his .csv file and re-upload.
However, in this instance, your system should only look up what has been modified.
I think this would save a lot of computation power on your servers too.
Atomic writes are good, but given that we have files with millions of rows, the current system is not very officient, because the data can not be 100% clean.
For example, in a file with 250 categories, I had forgotten to input in the database the name of a category, but it was existing in the database. Because of it, the csv upload failed at row 1150 and I had to re-upload.