🎁 New User? Get 20% off your first purchase with code NEWUSER20 · ⚡ Instant download · 🔒 Secure checkout Register Now →
Menu

Categories

Databases Intermediate

What is Transaction?

A sequence of database operations that are treated as a single unit — either all succeed or all are rolled back.

Transactions ensure data consistency through ACID properties: Atomicity (all or nothing), Consistency (valid state transitions), Isolation (concurrent transactions don't interfere), and Durability (committed data persists).

Commands include BEGIN/START TRANSACTION, COMMIT (save changes), and ROLLBACK (undo changes). Isolation levels (READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE) balance consistency and performance.

Related Terms

Prepared Statement
A pre-compiled SQL template that uses parameters instead of literal values, preventing SQL injection and improving performance.
Database Index Types
Different index structures (B-tree, Hash, GIN, GiST, BRIN) optimized for various query patterns and data types.
Vacuum
A PostgreSQL maintenance operation that reclaims storage from dead tuples and updates statistics for the query planner.
Materialized View
A database object that stores the precomputed result of a query, offering faster reads at the cost of periodic refresh.
Database Connection Pooling
A technique that maintains a cache of database connections for reuse, reducing the overhead of creating new connections.
ACID
A set of four properties (Atomicity, Consistency, Isolation, Durability) that guarantee reliable database transactions.
View All Databases Terms →