4 ms·
Async ACID DB interfaces are so weird to me. I guess the async all the things! is frustrating since I’m brought in when things go boom, and folks that couldn’t
by salmo 5y ago
Async ACID DB interfaces are so weird to me. I guess the async all the things! is frustrating since I’m brought in when things go boom, and folks that couldn’t deal with parallelism are all up in concurrency and baffled by the result.
I get going for throughput over transactional performance. But I don’t find that to be a practical goal in most business systems.
In my experience every dev team that goes this route thinks “async is faster”, then gets confused when their latency shifts dramatically under load. Or their CPU usage jumps from 20% to all the CPU they can get.
It’s especially odd with the (overly) microservices trend. A bunch of variable latency calls with a ton of network I/O overhead required to service 1 customer request. Shove those into tiny containers without any tuning and wooo!
And probably exacerbating this is the trend to tack on afterthought async frameworks to languages like Python and Java, vs systems designed with it originally like Erlang and even Go.
Folks familiar with Java or Python are suddenly lost troubleshooting. Stack traces, thread dumps, etc. become confusing. It’s not impossible, but the majority of developers are procedural themselves. I’ve only known a handful (out of thousands of contractors and employees) that were familiar with syscalls or could find useful info in a JFR.
All that said, I’m looking at “big old company” workloads. Python for analytics, where it’s a friendly wrapper around C/FORTRAN, and Java for most everything else. And most async use is what I would call “YouTube driven development.”
Ok, I’ve gone full “kids these days.”
It’s interesting stuff, for sure. I just wish there were giant disclaimers around it for every library or framework. Troubleshooting async performance issues is my new troubleshooting C/C++ memory issues of old.
- deleted 5y ago[deleted]
- ralusek 5y agoAvoiding async in order to avoid parallel database calls literally only makes sense if you're choosing between blocking/non-blocking on a single process on a single server instance. The second you scale up to use multiple processes/threads and/or multiple servers, you're going to be dealing with concurrent db calls regardless of whether or not your code is written as blocking or non-blocking. So not only are you saying that you insist on writing blocking code in order to avoid parallelism, but you're also saying that you'll limit yourself to a single execution process. Assuming a 50ms round trip to the db, you're basically setting a best case scenario of ~20 requests per second.