Đang mở hậu trường...
3 câu hỏi kỹ thuật chủ đề Cơ sở dữ liệu, song ngữ Anh-Việt, có đáp án và giải thích.
Your team runs a reporting query on PostgreSQL inside a transaction set to READ COMMITTED. The query reads the `orders` table twice within the same transaction; between the two reads, another session commits an UPDATE to one of the rows being read. The second read returns a different value for that row. Which anomaly is this, and which isolation level is the lowest one that would prevent it?
Your team runs an online store on PostgreSQL. A report query reads the row for product #42 (price = 100), and a few milliseconds later, within the SAME transaction, reads that row again and now sees price = 120 because another transaction committed an update in between. The transaction is running at the READ COMMITTED isolation level. What is this anomaly called, and what is the lowest standard isolation level that would prevent it?
You are architecting a globally distributed e-commerce platform that employs a multi-region active-active replication strategy. To ensure low checkout latency, the read-heavy validation service performs queries against the nearest local replica. When a user updates their shopping cart and immediately triggers a checkout transaction, the system occasionally fails validation due to state inconsistency. Which distributed database phenomenon best explains the root cause of this failure mode?