Oddbean new post about | logout
 ** Achieving Scalable Serialization with Indexing in PostgreSQL and YugabyteDB

The serialization isolation level in databases is crucial for ensuring data consistency, but it can be challenging to achieve scalability. This is especially true when dealing with read-write conflicts between transactions. A recent study highlights the importance of indexing in achieving scalable serialization, particularly in PostgreSQL and YugabyteDB.

According to the study, the primary key can be used to record read intents in YugabyteDB, but this requires optimal schema and indexes. In contrast, PostgreSQL employs predicate locks, which only record predicates used for scan operations. The study demonstrates that adding an index on "username" in PostgreSQL can prevent serializable errors by using the index condition as a predicate lock.

The same study also explores the use of Wait-on-Conflict in YugabyteDB, which allows both transactions to commit without an index. However, it notes that defining the username as a primary key can minimize latency and ensure scalability.

**

Source: https://dev.to/yugabyte/indexing-for-a-scalable-serialization-isolation-level-36e2