Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is serializability same as sequential consistency?

I have found people answering differences between linearizability and searializability, but nowhere have I found people either saying that serializability is same as sequential consistency or it is different from that.

Also I have been pounded with different definitions of the above terms in different articles, books and web pages and I have confused it all. Could someone please explain the difference between serializability and sequential consistency is it exists.

I would appreciate formal definitions of the above terms additionally if possible (both in plain English and in terms of the program or execution histories).

like image 863
Prakhar Agrawal Avatar asked Apr 05 '17 16:04

Prakhar Agrawal


People also ask

What is meant by sequential consistency?

Sequential consistency is a strong safety property for concurrent systems. Informally, sequential consistency implies that operations appear to take place in some total order, and that that order is consistent with the order of operations on each individual process.

What does serializability mean?

Informally, serializability means that transactions appear to have occurred in some total order. Serializability is a transactional model: operations (usually termed “transactions”) can involve several primitive sub-operations performed in order.

What is linearizability and sequential consistency?

In sequential consistency events are only related by program order, i.e., two events that happen in different threads are not related. In linearizability we also require that each method call takes effect at some point between the methods invocation and its response.

How causal consistency is different from sequential consistency?

a) Sequential Consistency → Causal Consistency In sequential consistency, all writes must be seen in the same order by all processes. In causal consistency, causally related writes must be seen in the same order.


1 Answers

Serializability is more strict than Sequential consistency.

The definition of Sequential consistency in wiki: The result of any execution is the same as if the operations of all the processors were executed in some sequential order, and the operations of each individual processor appear in this sequence in the order specified by its program.

And, the definition of Serializability in wiki: A transaction schedule is serializable if its outcome (e.g., the resulting database state) is equal to the outcome of its transactions executed serially, i.e. without overlapping in time.

So, the granularity of Sequential consistency is a single operation (e.g., read or write), while that of Serializability is a transaction (i.e., a sequence of operations).

In other words, if a program satisfies serializablity, it also satisfies sequential consistency, and not vice versa.

like image 130
KikiYu Avatar answered Jan 02 '23 19:01

KikiYu