I started working on the 4th issue (Bulk import data to MySQL in chunks).
The flow of importing the tsv file to the database is:
- Generate the folder name, delete the folder if it exists and create a new one.
- Split the tsv file into chunks and place it in the folder.
- Insert the chunks one at a time.
- If the import fails at any given chunk then rollback the execution to a previous stable state.
- Commit the transaction.