DELAPARRA
Index
Color
NL
Category: SQL

SERIALIZABLE

Explained by Updated

What is SERIALIZABLE?

SERIALIZABLE: Strongest level — transactions behave as if run one after another. Prevents phantoms at the cost of more aborts/locks. SERIALIZABLE is the strictest transaction isolation level. Transactions behave as if they ran one after another, never at the same time, even though the database actually runs them concurrently. It prevents every concurrency anomaly, including phantom reads and subtle write conflicts. The cost is that the database must sometimes abort a transaction because it would break that guarantee, and your application has to retry it.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about SERIALIZABLE

What should you keep in mind with SERIALIZABLE?

It makes sense for small, critical operations where correctness matters more than speed, such as financial transfers or allocating limited resources. PostgreSQL implements it efficiently with Serializable Snapshot Isolation. Using it everywhere usually hurts performance. A more common approach is the default isolation level combined with row locks, atomic updates and unique constraints for the few places that need them.

What does an example of SERIALIZABLE look like?

SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;

At a glance

CategorySQL
Explained by
Updated

More SQL terms

All terms starting with S

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.