Recently in the study of the knowledge of the db, readily made some summary, convenient for later review:
Before that, the database model I knew was a relational database system, called Rdmbs, which followed the acid principle.
A is atomic (atomicity), the atomicity between things means that all operations are either done or not.
C refers to consistency (consistency), the operation of things will not change the original consistency of the database.
I refers to independence (isolation), which means that there is no effect between things that are concurrent.
D refers to persistence (durability), which means that once a thing is committed, the changes will be kept on the database forever, even if the outage occurs.
NoSQL, refers to a non-relational database. NoSQL, sometimes referred to as the abbreviation of not-only SQL, is a generic term for a database management system that differs from a traditional relational database.
NoSQL is used for storage of hyper-scale data. (for example, Google or Facebook collects trillions of bits of data for their users every day). These types of data stores do not require a fixed pattern and can be scaled horizontally without extra action.
RDBMS vs NoSQL
Rdbms
-Highly organized structured data
-Structured Query Language (SQL) (SQL)
-Data and relationships are stored in separate tables.
-Data manipulation language, data definition language
-Strict consistency
-Basic services
Nosql
-represents more than just SQL
-No declarative query language
-No pre-defined pattern
-key-value pair storage, column storage, document storage, graphics database
-final consistency, not ACID properties
-Unstructured and unpredictable data
-Cap theorem
-High performance, high availability and scalability
Cap theorem (Cap theorem)
In computer science, the cap theorem (Cap theorem), also known as the Brewer's theorem (Brewer's theorem), points out that it is impossible for a distributed computing system to meet the following three points:
- Consistency (consistency) (all nodes have the same data at the same time)
- Availability (availability) (Ensure that each request responds regardless of success or failure)
- Segregation tolerance (Partition tolerance) (loss or failure of any information in the system will not affect the continued operation of the system)
The core of the CAP theory is that a distributed system cannot meet the three requirements of consistency, availability, and partition fault tolerance at the same time, and can only satisfy two at the same time.
Therefore, according to the CAP principle, the NoSQL database is divided into three categories: satisfying the CA principle, satisfying CP principle and satisfying AP principle.
- CA-A single point of clustering, a system that meets consistency, availability, is often less scalable.
- CP-systems that meet consistency, partitioning tolerance, and generally performance are not particularly high.
- APS-systems that satisfy availability, partitioning tolerance, and generally may have a lower consistency requirement.
BASE
Base:basically Available, soft-state, eventually consistent. Defined by Eric Brewer.
The core of the CAP theory is that a distributed system cannot meet the three requirements of consistency, availability, and partition fault tolerance at the same time, and can only satisfy two at the same time.
Base is the weak requirement that NoSQL databases typically have for usability and consistency:
- Basically availble--Basic available
- Soft-state-Soft state/flexible transaction. "Soft state" can be understood as "no connection", while "hard state" is "connection oriented"
- Eventual consistency-final consistency is ultimately the ultimate goal of ACID.
ACID vs BASE
ACID |
BASE |
Atomicity (Atomicity) |
Basic available (Basically Available) |
Consistency (Consistency) |
Soft-state/flexible transactions (S-oft states) |
Isolation (Isolation) |
Final consistency (Eventual consistency) |
Persistence (Durable) |
|
NoSQL with notes 1