Big Data Storage
Click to edit Master title style
Concepts
Chapter 5
Part b
1
Contents
Click to edit Master title style
• CAP
• No SQL
• ACID
• BASE
2 2
CAP Theorem
Click to edit Master title style
• The CAP Theorem is a fundamental theorem in distributed systems that
states any distributed system can have at most two of the following
three properties.
• Consistency (C)
• Availability (A)
• Partition tolerance (P)
• The CAP theorem states that a distributed system running in cluster
cannot simultaneously be consistence, available and partition
tolerance.
3 3
CAP Theorem
Click cont.. title style
to edit Master
• Consistency- Data same across multiple nodes.
• A read from any node results in the same data across multiple nodes.
4 4
CAP Theorem
Click cont..title style
to edit Master
• Availability:
• A read/write request will always be acknowledged in the form of a
success or a failure.
5 5
CAP to
Click Theorem cont..
edit Master title style
• Partition tolerance:
• The database system can tolerate communication outages that split
the cluster into multiple partition and can still service read/write
requests.
6 6
Click to edit Master
CAP Theorem cont.. title style
• The following scenarios demonstrate
why only two of the three properties of
the CAP theorem are simultaneously
supportable.
7 7
ACIDto edit Master title style
Click
• ACID is a database design principle related to transaction
management. It is an acronym that stands for:
• atomicity
• consistency
• isolation
• durability
• ACID is a relational database transaction management style that
leverages pessimistic concurrency controls to ensure
consistency is maintained through the application of record
locks.
8 8
ACIDtoAtomicity
Click edit Master title style
• Atomicity ensures that all operations will always succeed or
fail completely. In other words, there are no partial
transactions.
• The following steps illustrate the atomicity:
1. A user attempts to update three records as a part of a
transaction.
2. Two records are successfully updated before the
occurrence of an error.
3. As a result, the database roll backs any partial effects of
the transaction and puts the system back to its prior state.
9 9
ACID-
Click to Consistency
edit Master title style
• Consistency ensures that the database will always remain
in a consistent state by ensuring that only data that
conforms to the constraints of the database schema can be
written to the database.
• Thus a database that is in a consistent state will remain in
a consistent state following a successful transaction.
1.A user attempts to update the amount column of the
table that is of type float with a varchar value.
2.The database applies its validation check and rejects
this update because the value violates the constraint
checks for the amount column. 10
10
ACID-
Click to Isolation
edit Master title style
• Isolation ensures that the results of a transaction
are not visible to other operations until it is
complete.
1.User A attempts to update two records as part of a
transaction.
2.The database successfully updates the first record.
3.However, before it can update the second record,
User B attempts to update the same record. The
database does not permit User B’s update until User
A’s update succeeds or fails in full.
11
11
ACID-
Click to Durability
edit Master title style
• Durability ensures that the results of an operation are
permanent. In other words, once a transaction has been
committed, it cannot be rolled back. This is irrespective
of any system failure.
1.A user updates a record as part of a transaction.
2.The database successfully updates the record.
3.Right after this update, a power failure occurs. The
database maintains its state while there is no power.
4.The power is resumed.
5.The database serves the record as per last update
when requested by the user.
12
12
Soft to
Click State
edit Master title style
•Soft state means that a database may be in an
inconsistent state when data is read; thus, the results may
change if the same data is requested again.
•This property is closely related to eventual consistency.
1.User A updates a record on Peer A.
2.Before the other peers are updated, User B requests
the same record from Peer C.
3.The database is now in a soft state, and stale data is
returned to User B.
13
13