search
HomeDatabaseSQLWhat are the characteristics of nosql database

nosql features: 1. Flexible scalability; nosql removes the relational characteristics of relational databases, there is no relationship between data, and it can be easily expanded. 2. Flexible data model; NoSQL uses non-relational models such as key/value and column family, allowing different types of data to be stored in one data element. 3. NoSQL can rely on its good horizontal expansion capabilities to make full use of cloud computing infrastructure and integrate well into the cloud computing environment. 4. Nosql has very high reading and writing performance, especially when dealing with large amounts of data. 5. High availability.

What are the characteristics of nosql database

The operating environment of this tutorial: Windows 7 system, Dell G3 computer.

Introduction to NoSQL

NoSQL is a database management system design method that is different from relational databases. The general term for relational database. The data model it uses is not the relational model of traditional relational databases, but non-relational models such as key/value, column family, document, etc. NoSQL databases do not have a fixed table structure, there are usually no join operations, and they do not strictly adhere to ACID constraints. Therefore, compared with relational databases, NoSQL has flexible horizontal scalability and can support massive data storage.

What is ACID?

  • Atomicity of transactions (Atomicity): means that a transaction is either fully executed or not executed, which means that a transaction is impossible It stopped only halfway through. For example, if you withdraw money from an ATM, this transaction can be divided into two steps: 1 swipe the card, and 2 withdraw the money. It is impossible to swipe the card but the money does not come out. These two steps must be completed at the same time or not completed at all.
  • Consistency of transaction(Consistency): means that the running of the transaction does not change the consistency of the data in the database. For example, the integrity constraint a b=10, and a transaction changes a, then b should also change accordingly.
  • INDEPENDENCE(Isolation):The independence of transactions is also called isolation, which means that two or more transactions will not be executed in an interleaved manner. Because this may lead to data inconsistency.
  • Durability(Durability):The durability of a transaction means that after the transaction is executed successfully, the changes made by the transaction to the database are permanently saved in the database and will not be rolled back for no reason

Characteristics of NoSQL database

1) Flexible scalability

Traditional relational databases are usually difficult to achieve "horizontal expansion" due to their own design mechanisms. When facing a large-scale increase in database load, , it is often necessary to upgrade hardware to achieve "vertical expansion." NoSQLThe database was originally designed to meet the needs of "horizontal expansion", so it is inherently equipped with good horizontal expansion capabilities.

2)Flexible data model

Relational databases have standardized definitions and comply with various strict constraints. Although this approach ensures the data consistency requirements of the business system, the overly rigid data model also means that it cannot meet various emerging business needs. In contrast, NoSQL databases use non-relational models such as keys, /values, column families, etc., allowing different types of data to be stored in one data element. data.

3)Tightly integrated with cloud computing

Cloud computing has good horizontal expansion capabilities and can be freely scaled according to resource usage. Various resources can be dynamically added or withdrawn. NoSQL databases can rely on their own good horizontal expansion. Ability to make full and free use of cloud computing infrastructure, integrate well into the cloud computing environment, and build cloud database services based on NoSQL.

(4) Large data volume, high performance

nosql database has very high read and write performance, especially under large data volume, It also performs very well, mainly due to its non-relationship and simple database structure.

Usually nosql uses Query Cache.

nosql's Cache is record-level, a fine-grained Cache, so from this aspect, the performance of nosql is much higher.

(5) High availability

High availability is also an obvious feature of nosql. Nosql can be implemented very conveniently without affecting performance. Highly available architecture, typical examples include Cassandra and HBase models. High availability can also be achieved through models.

Reasons for the rise of NoSQL

1 Relational databases can no longer satisfy The requirements of Web2.0. Mainly manifested in the following aspects:

  • (1) cannot meet the management needs of massive data

  • For the above websites, it will soon be possible Generating more than 10# billion records, for a relational database, in a table with 10SQLQuery is extremely inefficient.

  • 2)cannot satisfy Requirements for high data concurrency

  • 3) cannot meet the requirements of high scalability and high availability

2, The key to relational database Features have become "tasteless" in the era of Web 2.0

The key features of relational databases include complete transaction mechanisms and efficient query mechanisms. However, the two key features that relational databases are proud of have become useless in the Web2.0 era, mainly in the following aspects:

(1) Web 2.0 website systems usually do not require strict database transactions

For many Web 2.0 websites, database transactions are no longer So important. Database transactions usually have a complex implementation mechanism to ensure database consistency, which requires a lot of system overhead. For Web 2.0 websites that contain a large number of frequent real-time read and write requests, the cost of implementing transactions is unbearable.

(2)Web 2.0 does not require strict real-time performance of reading and writing

For relational databases, once a data record is successfully inserted into the database, it can be queried immediately.

For Web 2.0, there is no such real-time reading and writing requirements.

(3) Web 2.0 usually does not contain a large number of complex SQL queries

Complex SQL queries usually contain multiple Table join operations. However, Web 2.0 websites have been designed to minimize or even avoid such operations, and usually only use primary key queries of a single table. Therefore, the query optimization mechanism of relational databases is difficult to make a difference in Web 2.0.

Comparison of NoSQL and relational databases

RDBMS: relational database

What are the characteristics of nosql database

What are the characteristics of nosql database

What are the characteristics of nosql database

##Comparison of NoSQL and relational databases Summary:

(1) Relational Database

Advantages: Based on the complete relational algebra theory, there are strict standards, supporting the four properties of transaction ACID, with the help of the index mechanism Can achieve efficient query, mature technology, technical support from professional companies

Disadvantages: Poor scalability, unable to support massive data storage, data model too rigid, unable to support Web2.0 applications, transaction mechanism affects the overall system Performance etc

2 NoSQLDatabase

##Advantages: Yes Supports ultra-large-scale data storage, the flexible data model can well support Web2.0 applications, and has strong horizontal expansion capabilities, etc.

Disadvantages: Lack of mathematical theoretical foundation, low performance of complex queries, mostly unable to achieve strong transaction consistency, difficult to achieve data integrity, technology is not yet mature, lack of professional team Technical support, difficult maintenance, etc.

(3) Relational databases and NoSQL databases each have their own advantages and disadvantages and cannot replace each other.

Relational database application scenarios

: Key business systems in telecommunications, banking and other fields need to ensure strong transaction consistency

NoSQL

Database application scenarios: Non-critical businesses of Internet companies and traditional companies (such as data analysis)

Adopt hybrid architecture

  • Case: Amazon uses different types of databases to support its e-commerce applications
  • For temporary data such as "shopping basket", use Key-value storage will be more efficient
  • The current product and order information is suitable for storage in a relational database

NoSQL The four major types of

NoSQLAlthough there are many databases, in summary, the typical NoSQLDatabases usually include key-value database, column family database, document database and graph database

1. Key-value database

Key-value database (Key-Value Database) has a specific Key and a pointer pointing to a specific Value in the table. Key can be used to locate Value, that is, to store and retrieve specific Value. Value is transparent and invisible to the database. Value cannot be indexed or queried, and can only be queried through Key. Value can be used to store any type of data, including integers, characters, arrays, objects, etc.

Application scenario:A session-oriented application (such as Web application) starts when the user logs in session and remains active until the user logs off or the session times out. During this time, the application stores all session-related data in main memory or in a database. Session data may include user profile information, messages, personalization data and themes, suggestions, targeted promotions and discounts. Each user session has a unique identifier. Session data cannot be queried on any key other than the primary key, so a fast key-value store is better suited for session data. In general, key-value databases may offer less overhead per page than relational databases.

What are the characteristics of nosql database

##2. Column family database

What are the characteristics of nosql database

##3. Document database

What are the characteristics of nosql database

##4. Graph database


What are the characteristics of nosql database

5. Comparative analysis of different types of databases


  • MySQL: was produced earlier and matured with the LAMP trend. Although there are no major improvements, the most used database on the emerging Internet
  • MongoDB: is a new thing that provides more flexibility Data model, asynchronous submission, geographical location index and other various functions
  • HBase: is a "bullying" elephant soldiers. Relying on the ecological environment of Hadoop, it can have good scalability. But just like the elephant soldier, the user needs to raise an elephant (Hadoop), to drive him
  • Redis: is a representative of key-value storage and has the simplest function. Provide random data storage. Just like a stick, there is no extra structure. But precisely because of this, its scalability is particularly good. Just like the golden cudgel in Wukong's hand, the big one can pierce the sky, and the small one can shrink into a needle

The three cornerstones of NoSQL

The so-called CAP refers to:

  • CConsistency) : Consistency means that any read operation can always read the result of the previously completed write operation. That is, in a distributed environment, data at multiple points is consistent , or in other words, all nodes have the same data at the same time
  • A:(Availability):Availability refers to obtaining data quickly and returning operation results within a certain time, ensuring that each request has a response regardless of success or failure;
  • ##P##Tolerance of Network Partition):Partition tolerance refers to when In the case of network partitioning (that is, some nodes in the system cannot communicate with other nodes), the separated system can also run normally, that is to say, the loss or failure of any information in the system will not affect the system The continued operation.
CAP

Theory tells us that it is impossible for a distributed system to meet the three requirements of consistency, availability and partition tolerance at the same time. Satisfying two of them at the same time is as the saying goes, "You can't have your cake and eat it too."

What are the characteristics of nosql database

When dealing with the problem of

CAP, there are a few obvious choices:

  • CA: that is, emphasizing consistency (C) and availability (A), give up partition tolerance (P), the simplest way is to put all transaction-related content on the same machine superior. Obviously, this approach will seriously affect the scalability of the system. Traditional relational databases (MySQL, SQL Server and PostgreSQL), all This design principle is adopted, so the scalability is relatively poor

  • CP: that is, the emphasis is on consistency sex (C) and partition tolerance (P), give up availability (A ), when a network partition occurs, the affected services need to wait for the data to be consistent, so they cannot provide external services during the waiting period

  • AP : That is, emphasizing availability (A) and partition tolerance (P), giving up consistency (C), allowing the system to return inconsistent data

##BASE

I mentioned ACID before, now let’s talk briefly about

BASE (B asically Availble, Soft-state, Eventual consistency)

##atomicityConsistency(/
##ACID

BASE

(Atomicity)

##Basically available
(

Basically A##vailable)

Consistency)Soft state

Flexible transaction(Soft state)

isolation(Isolation)

Eventual consistency(Eventual consistency)

Persistence(Durable)


## The basic meaning of

BASE is Basically available (Basically Availble), soft state (S oft-state) and eventual consistency (Eventual consistency) :

Basically available
       

Basically available means that when a part of a distributed system has a problem and becomes unavailable, other parts can still be used Normal use, that is, allowing partition failure to occur

Soft state
                                                     

soft-state)" is a formulation corresponding to "hard state (hard-state)". When the data stored in the database is in "hard state", data consistency can be guaranteed, that is, the data is always correct. "Soft state" means that the state can be out of sync for a period of time, with a certain lag

Eventual consistency

The types of consistency include strong consistency and weak consistency. The main difference between the two is whether subsequent operations can obtain the latest data under highly concurrent data access operations. For strong consistency, after an update operation is performed, other subsequent read operations can guarantee that the latest data after the update is read; conversely, if it cannot be guaranteed that subsequent accesses read the latest data after the update, then It's weak consistency. Final consistency is just a special case of weak consistency, which allows subsequent access operations to temporarily fail to read the updated data, but after a period of time, the updated data must eventually be read .

For more programming-related knowledge, please visit: Programming Teaching! !

The above is the detailed content of What are the characteristics of nosql database. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
SQL: A Beginner-Friendly Approach to Data Management?SQL: A Beginner-Friendly Approach to Data Management?Apr 19, 2025 am 12:12 AM

SQL is suitable for beginners because it is simple in syntax, powerful in function, and widely used in database systems. 1.SQL is used to manage relational databases and organize data through tables. 2. Basic operations include creating, inserting, querying, updating and deleting data. 3. Advanced usage such as JOIN, subquery and window functions enhance data analysis capabilities. 4. Common errors include syntax, logic and performance issues, which can be solved through inspection and optimization. 5. Performance optimization suggestions include using indexes, avoiding SELECT*, using EXPLAIN to analyze queries, normalizing databases, and improving code readability.

SQL in Action: Real-World Examples and Use CasesSQL in Action: Real-World Examples and Use CasesApr 18, 2025 am 12:13 AM

In practical applications, SQL is mainly used for data query and analysis, data integration and reporting, data cleaning and preprocessing, advanced usage and optimization, as well as handling complex queries and avoiding common errors. 1) Data query and analysis can be used to find the most sales product; 2) Data integration and reporting generate customer purchase reports through JOIN operations; 3) Data cleaning and preprocessing can delete abnormal age records; 4) Advanced usage and optimization include using window functions and creating indexes; 5) CTE and JOIN can be used to handle complex queries to avoid common errors such as SQL injection.

SQL and MySQL: Understanding the Core DifferencesSQL and MySQL: Understanding the Core DifferencesApr 17, 2025 am 12:03 AM

SQL is a standard language for managing relational databases, while MySQL is a specific database management system. SQL provides a unified syntax and is suitable for a variety of databases; MySQL is lightweight and open source, with stable performance but has bottlenecks in big data processing.

SQL: The Learning Curve for BeginnersSQL: The Learning Curve for BeginnersApr 16, 2025 am 12:11 AM

The SQL learning curve is steep, but it can be mastered through practice and understanding the core concepts. 1. Basic operations include SELECT, INSERT, UPDATE, DELETE. 2. Query execution is divided into three steps: analysis, optimization and execution. 3. Basic usage is such as querying employee information, and advanced usage is such as using JOIN connection table. 4. Common errors include not using alias and SQL injection, and parameterized query is required to prevent it. 5. Performance optimization is achieved by selecting necessary columns and maintaining code readability.

SQL: The Commands, MySQL: The EngineSQL: The Commands, MySQL: The EngineApr 15, 2025 am 12:04 AM

SQL commands are divided into five categories in MySQL: DQL, DDL, DML, DCL and TCL, and are used to define, operate and control database data. MySQL processes SQL commands through lexical analysis, syntax analysis, optimization and execution, and uses index and query optimizers to improve performance. Examples of usage include SELECT for data queries and JOIN for multi-table operations. Common errors include syntax, logic, and performance issues, and optimization strategies include using indexes, optimizing queries, and choosing the right storage engine.

SQL for Data Analysis: Advanced Techniques for Business IntelligenceSQL for Data Analysis: Advanced Techniques for Business IntelligenceApr 14, 2025 am 12:02 AM

Advanced query skills in SQL include subqueries, window functions, CTEs and complex JOINs, which can handle complex data analysis requirements. 1) Subquery is used to find the employees with the highest salary in each department. 2) Window functions and CTE are used to analyze employee salary growth trends. 3) Performance optimization strategies include index optimization, query rewriting and using partition tables.

MySQL: A Specific Implementation of SQLMySQL: A Specific Implementation of SQLApr 13, 2025 am 12:02 AM

MySQL is an open source relational database management system that provides standard SQL functions and extensions. 1) MySQL supports standard SQL operations such as CREATE, INSERT, UPDATE, DELETE, and extends the LIMIT clause. 2) It uses storage engines such as InnoDB and MyISAM, which are suitable for different scenarios. 3) Users can efficiently use MySQL through advanced functions such as creating tables, inserting data, and using stored procedures.

SQL: Making Data Management Accessible to AllSQL: Making Data Management Accessible to AllApr 12, 2025 am 12:14 AM

SQLmakesdatamanagementaccessibletoallbyprovidingasimpleyetpowerfultoolsetforqueryingandmanagingdatabases.1)Itworkswithrelationaldatabases,allowinguserstospecifywhattheywanttodowiththedata.2)SQL'sstrengthliesinfiltering,sorting,andjoiningdataacrosstab

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Atom editor mac version download

Atom editor mac version download

The most popular open source editor