this post was submitted on 12 Aug 2024
550 points (96.8% liked)

Comic Strips

12643 readers
4015 users here now

Comic Strips is a community for those who love comic stories.

The rules are simple:

Web of links

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] dan@upvote.au 3 points 3 months ago (1 children)

A single click in the software can often generate 500 SQL queries, so if you go from 0.05 ms to 1 ms latency you add half a second to clicks

Those queries don't all have to be executed sequentially though, do they? Usually if you have that many queries, at least some of them are completely independent of the others and thus can execute concurrently.

You don't even need threading for that, just non-blocking IO and ideally an event loop.

[โ€“] tias@discuss.tchncs.de 2 points 3 months ago* (last edited 3 months ago)

The catch is that they all need to run in the same transaction to be unaffected by other things going on in the database and to make updates atomic. A single transaction means a single connection, and ODBC/JDBC has no way of multiplexing or pipelining queries over a single connection.

It's probably theoretically possible to run some things in different transactions. But with all the different layers and complexity of the code (including third party components and ORMs like Hibernate), understanding all the failure modes and possible concurrency issues becomes intractable.