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
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
inserts at the same time.
My question is:
If I have set
concurrent_insert=2, will multiple-
inserts still cause the locking of table so that I would get a very bad performance (all of
inserts have to be handled one by one)? Or MySQL itself can handle the multiple-
inserts properly so I can get a not-bad performance?
For the multiple-
inserts, is there any difference between “sharing one connection object” and “each
insert has its own connection object”?