3 ms·
The presentation is clearly focused on high-performance use cases. In that context, they make a case that be it bad idea or good idea, it's your only choice, be
by jerf 11y ago
The presentation is clearly focused on high-performance use cases. In that context, they make a case that be it bad idea or good idea, it's your only choice, because you can't afford a back-and-forth conversation between the program and the database for every little query.
How true that is I can't personally vouch for, having never examined the network protocols for the DBs that closely. I'm not sure what the conversation is that they are referencing when it seems like the client can send the query + all data in one shot and the server ought to be able to start streaming responses pretty quickly. But it wouldn't be the first time that either the protocols or my understanding of the situation is suboptimal. I'm really just relaying the argument and making the point that the context matters. There's a lot of DB usage in the world where none of this matters because your performance needs are frankly blown away by what even "slow" DBs can do.
- jhugg 11y agoConsider the op, "put me in line if the line isn't full" Query 1: Check if the line is full. Query 2: Conditionally put me in line. First, this requires two trips. Second, the line could fill up between these two trips, cause the second line to put you in a full line. So, you hold a lock between the two statements. Now you have a third round trip to commit or abort, and the line is frozen for new additions while you talk over the network for two more round trips. Some examples are better, some worse, but this kind of thing is way better if you bundle up the logic and send it in one round trip.