I have a relatively simple object model:
ParentObject
Collection<ChildObject1>
ChildObject2
The MySQL operation when saving this object model does the following:
- Update the
ParentObject
- Delete all previous items from the
ChildObject1
table (about 10 rows) - Insert all new
ChildObject1
(again, about 10 rows) - Insert
ChildObject2
The objects / tables are unremarkable - no strings
, rather mainly ints
and longs
.
MySQL is currently saving about 20-30 instances of the object model per second. When this goes into prodcution it's going to be doing upwards of a million saves, which at current speeds is going to take 10+ hours, which is no good to me...
I am using Java and Spring. I have profiled my app and the bottle neck is in the calls to MySQL by a long distance.
How would you suggest I increase the throughput?