
Phantom Read
A phantom read occurs in a database when a transaction reads a set of records, and later reads again expecting the same data, but finds additional records that appeared due to other transactions inserting new data in the meantime. Essentially, the initial data set "disappears" or changes unexpectedly because new, matching records have "materialized" or been added, like encountering "phantoms." This happens in systems with lower isolation levels, where concurrent transactions can interfere with each other, leading to inconsistencies. To prevent phantom reads, higher isolation levels like serializable are used, ensuring stable, predictable data during a transaction.