跳到主要內容

發表文章

目前顯示的是有「data」標籤的文章

Distributed transactions

Table of contents [ hide ] Basic theory  CAP States that any distributed data store can provide only two of the following three guarantees. Consistency Every read receives the most recent write or an error. Availability Every request receives a (non-error) response, without the guarantee that it contains the most recent write. Partition tolerance The system continues to operate despite an arbitrary number of messages being dropped (or delayed) by the network between nodes. Typical architecture of distributed systems When a network partition failure happens, it must be decided  whether to do one of the following: CP: cancel the operation and thus decrease the availability but ensure consistency AP: proceed with the operation and thus provide availability but risk inconsistency. BASE Basically-available, soft-state, eventual consistency. Base theory is the practical application of CAP theory, that is, under the premise of the existence of partitions and copies, through certain syste

Consistency

Table of contents [ hide ] Consistency is essential for transactions between distributed systems and individual systems. Some concepts will be discussed here. ACID Atomicity: Atomicity guarantees that each transaction is treated as a single "unit", which either succeeds completely or fails completely. Consistency: Consistency ensures that a transaction can only bring the database from one consistent state to another, preserving database invariants: any data written to the database must be valid according to all defined rules, including constraints, cascades, triggers, and any combination thereof. Isolation: Isolation ensures that the concurrent execution of transactions leaves the database in the same state that would have been obtained if the transactions were executed sequentially. Durability: Durability guarantees that once a transaction has been committed, it will remain committed even in the case of a system failure (e.g., a power outage or crash). Isolation Levels