Posts

Showing posts with the label serializable

Transaction with Isolation Level

Image
Introduction This is a concept created by Postgres as a set of behavior rules to decide whether other people can see or edit data when someone is modifying it. The isolation level only makes sense and only works when accompanied by a Transaction. This is the factor that ensures Isolation, helping to decide how parallel transactions handle operations independently of each other. When you execute a single statement like UPDATE products SET price = 100, Postgres activates Autocommit mode to automatically wrap the statement with BEGIN...COMMIT. It automatically creates a Transaction for extremely fast execution. Levels There are currently 4 levels ranging from the most relaxed to the strictest. The stricter the level, the more accurate the data, but the system runs slightly slower. Read Uncommitted This is the most relaxed level, allowing you to see what others are drafting even if they have not yet committed. Because of that characteristic, using it is very dangerous as it causes Dirty Re...