Ruby for All cover image

The Database Wizard with Andrew Atkinson

Ruby for All

00:00

Understanding Transactions and Locking in Rails and Database Engines

Transactions and locking in Rails are closely related to database engines, such as Postgres or MySQL. Every transaction has a corresponding lock type, which can be exclusive or shared, and these locks can be on different database objects, such as tables or rows. Exclusive locks on a table can block other transactions from reading the table, leading to potential errors or timeouts for end users. Balancing higher levels of concurrency with minimal locking is crucial to avoid lock contention, especially at scale. In higher levels of scale, successful applications with high concurrent usage can experience lock contention. Transactions per second are a key measure of database performance.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app