I'm a newbie on Database and for now I need to work with MySQL to build a web server.
In a word, I have a web framework, developed with Python. It will read/write data from/into MySQL.
For now I don't know how to handle the case of multithreading insert
.
Let's say there are many users, who are writing their data into one table. I will use a thread pool to process these requests, meaning that there would be multiple insert
s at the same time.
My question is:
If I have set concurrent_insert=2
, will multiple-insert
s still cause the locking of table so that I would get a very bad performance (all of insert
s have to be handled one by one)? Or MySQL itself can handle the multiple-insert
s properly so I can get a not-bad performance?
For the multiple-insert
s, is there any difference between "sharing one connection object" and "each insert
has its own connection object"?