3 ms·
There are ways to mitigate this if your ORM is good. I made the poor decision of moving to a much more powerful but geographically distant DB a while back, and
by kbenson 9y ago
There are ways to mitigate this if your ORM is good. I made the poor decision of moving to a much more powerful but geographically distant DB a while back, and while some operations benefit greatly from the extra hardware and memory, you really learn where your inefficiencies are when there's a 50 millisecond round trip involved and you find you're hitting the DB a few hundred or thousand times for this task.
Pre-fetching relations is amazingly useful in that context, as are alternate input methods that allow multiple inserts in a single glue opening (but be prepared to divide.and conquer if one or more items might fail to insert, such as when a unique key has a duplicate). Updates are generally the biggest problem, but if you're lucky you can reduce those by grouping similar updates into single update statements.
Many of these have more specific solutions depending on the particular RDBMS you are using, but ORM support for those features is generally poor. If you're lucky your ORM is extensible enough that you can hack some in without too much effort and while being fairly clean.
- AlphaSite 9y agoFrom what I remember batch operations are a part of the JDBC core.