Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences between Strict Serializable and External Consistency

I follow this great blog. In this blog, the author has drawn a complete picture of all types of isolation and consistency and the relationship between them. enter image description here

But based on the Google's blog, there is another type of consistency named External Consistency which is provided by Google's Spanner database. As I understood:

External consistency = Strongly Consistency + Strict Serializable

After some research, the definition of external consistency might be:

For any two transactions, 𝑇1 and 𝑇2 (even if on opposite sides of the globe): if 𝑇2 starts to commit after 𝑇1 finishes committing, then the timestamp for 𝑇2 is greater than the timestamp for 𝑇1.

I still don't see the differences between External consistency and Strict Serializability. Please give me an example that it satisfies Strict Serializability but not External Consistency.

Thanks

like image 678
TrαΊ§n Kim Dα»± Avatar asked Feb 23 '20 17:02

TrαΊ§n Kim Dα»±


People also ask

What is external consistency?

External consistency is a property of transaction-processing systems, where clients dynamically synthesize transactions that contain multiple read and write operations on arbitrary objects.

What is Linearizable consistency?

Linearizability is the strongest form of consistency. This means that all operations are executed in a way as if executed on a single machine, despite the data being distributed across multiple replicas. As a result, every operation returns an up-to-date value.

Does linearizability imply serializability?

The central distinction between the two is that serializability is a global property; a property of an entire history of operations/transactions. Linearizability is a local property; a property of a single operation/transaction.

Is spanner strongly consistent?

Spanner is a strongly-consistent, distributed, scalable database built by Google engineers to support some of Google's most critical applications. It takes core ideas from the database and distributed systems communities and expands on them in new ways.


Video Answer


1 Answers

Serializability requires that transactions appear to occur sequentially. Serializability does not require any particular ordering on the serial schedule to which the transaction executions be equivalent to.

Strict serializability requires serializability, but also imposes a condition on the order of the serial schedule to which the transaction execution is equivalent to: a transaction that commits before a different transaction starts must appear to happen first. Suppose A commits before B starts--A must appear to take effect before B. With a single node system this comes for free with serializability, and no one really discusses it in this context. In a distributed system it's very hard. See https://cs.brown.edu/~mph/HerlihyW90/p463-herlihy.pdf.

External consistency is a little different. External consistency requires that a transaction that commits before a different transaction commits must appear to happen first. Suppose A commits before B commits--A must appear to take effect first. See here for a definition of external consistency.

The subtle distinction here is that strict serializability imposes no order on concurrent transactions, whereas external consistency imposes a total order on all transactions. External consistency is therefore a stronger condition in the sense that any externally consistent system is also strictly serializable.

like image 50
aaw Avatar answered Sep 22 '22 12:09

aaw