2 ms·
On the other hand cloud sql is 400 micros from web servers. 10 round trips is like 10ms.. Not even visible to an end user.
by brianwawok 11y ago
On the other hand cloud sql is 400 micros from web servers. 10 round trips is like 10ms.. Not even visible to an end user.
- jhugg 11y agoIf you need to hold a lock for 10ms in order to ensure things are transactional, it can have a bigger impact. Also, if you get a slow delivery even N packets, where N seems large, you’ve just incresed your chances of hitting that issue 10x. This is brutal on long tail latencies. But no, not all systems need this.
- brianwawok 11y agoYa exactly. If you are writing something high performance, I don't think you want locks. You are more likely to do append only and sort it out when you do a read or such (or fancy magic down the Cassandra route). For stupid webapp, meh. Most of the time when a page load takes 10 round trips to the DB it is not for a lock, it is to read a bunch of tables to render a page.
- qaq 11y agoAnd parsing the query and generating a query plan for those 10 queries is obviously free.
- marcosdumay 11y agoThat's often done once and cached. It is worth keeping one eye at those things. They can slow your program down badly, and go unnoticed a lot of times. But most of the time they don't slow you down at all, and when they do it's often much better to solve the problem by rewriting your queries into something that batches more data. Yes, once in a long while it makes sense to create a stored procedure to deal with it. But this is the exceptional situation that deserves explaining - not the other way around.
- ajmurmann 11y agoYou can also solve this with prepared statements which for example Active Record does for you for free.