There are several techniques to upload data.
Personally I use JSON.
I have had to send 1600,000 records to the postgresql server, I put together the json (50 - 60 thousand records at a time) and pass it to a function, it receives it and inserts it into the table, the process on the server side is very fast.
When I have many records I use Copy which is much faster.
COPY public.data_load FROM ‘/path/data_migra.csv’ DELIMITER ‘,’ CSV HEADER;
If I’m not wrong in mysql LOAD DATA LOCAL INFILE
Greetings
Mauricio