What is a database transaction?
41–50 of 70 posts
Re: What is a database transaction?
#42Re: What is a database transaction?
#43Is it just me, or are the final results of the deadlock visualisations incorrect? In both animations (mysql/pg), the final `SELECT balance from account...` queries appear to show the result of the two sessions, which have been terminated.
Re: What is a database transaction?
#44In the section about serializable read TFA gets the `accounts` `balance` wrong.
Re: What is a database transaction?
#45Have you ever seen anyone changing transaction isolation levels in code? I think pessimistic or optimistic locking is preferred way to handle transaction concurrency.
Re: What is a database transaction?
#46Seems like a frequent surprise is that Postgres and MySQL don't default to serializable (so not fully I in ACID). They do read-committed. I didn't see this article mention that, but maybe I missed it. The article says read-committed provides "slightly" better performance, but it's been way faster in my experience. Forget where, but I think they said they chose this default for that reason. Using read-committed ofc me…
https://dev.mysql.com/doc/refman/8.4/en/set-transaction.html...
https://mariadb.com/docs/server/reference/sql-statements/adm...
I don't know about MyISAM though (who uses it anyway ;-) ).
Re: What is a database transaction?
#47In the section about serializable read TFA gets the `accounts` `balance` wrong.
Re: What is a database transaction?
#48We built an entire project for a client-side project with millions of SQL rows and thousands of users without adding a single transaction. :/
Re: What is a database transaction?
#49I’ve found this article lacking. Like some other articles in this space, it introduces isolation levels through the lens of the phenomena described in the SQL standard, but I find that there’s a different, more intuitive approach. I think it’s more tractable to define this problem space starting from the concept of (strict) serializability, which is really a generalization of the concept of thread safety. Every softw…
Most RDBMSs offer serializable isolation if you need it. Often you don't need it. The downside of using serializable isolation unnecessarily is reduced concurrency and throughput due to increased coordination between transactions.
Re: What is a database transaction?
#50Earlier quoted context omitted.
The issue with SERIALIZABLE, aside from performance, is that transactions can fail due to conflicts/deadlocks/timeouts, so application code must be prepared to recognize those cases and have a strategy to retry the transactions.
Right. So my code had a helper to run some inner func in a serializable xact, in rw or ro mode, which would retry with backoff. Like the TransactionRunner in Spanner. But even with no retries occurring, it was very slow.
I'm using the past tense here, but VoltDB is still going. I don't think it's as well-known as it deserves to be.