nosql--Introduction

NoSQL, generally refers to non-relational databases. With the rise of Internet web 2.0 websites, traditional relational databases have become incapable of dealing with web 2.0 websites, especially ultra-large-scale and high-concurrency SNS - type web 2.0 pure dynamic websites , exposing many insurmountable problems. , while the non-relational database has developed very rapidly due to its own characteristics. The NoSQL database was created to solve the challenges brought by large-scale data collection and multiple data types, especially the application of big data.


(1) Four major categories of NoSQL databases


(1) Key-Value storage database
This type of database mainly uses a hash table , which has a specific key and a pointer to specific data. The advantage of the key/value model for IT systems is that it is simple and easy to deploy. However, if the DBA only queries or updates part of the value, the key/value becomes inefficient.  For example: Tokyo Cabinet/Tyrant, Redis, Voldemort, Oracle BDB.
Typical application scenarios: content caching, mainly used to handle high access loads of large amounts of data, and also used in some log systems, etc.
 Data model: Key points to the key-value pair of Value, usually implemented by hash table
Advantages and disadvantages: fast search speed; unstructured data, usually only treated as string or binary data
(2) Column store database.
This part of the database is usually used to deal with massive data in distributed storage. The keys still exist, but they are characterized by pointing to multiple columns. The columns are arranged by column families. Such as: Cassandra, HBase, Riak.
Typical application scenario: distributed file system
 Data Model: Stored in a column cluster, storing the same column data together
Advantages and disadvantages: fast search speed, strong scalability, easier distributed expansion; relatively limited functions

(3) Document database
The document database is inspired by the Lotus Notes office software, and it is similar to the first key-value store. The data model of this type is versioned documents, semi-structured documents stored in a specific format, such as JSON. A document database can be seen as an upgraded version of a key-value database, allowing nested keys and values. Moreover, the query efficiency of document database is higher than that of key-value database. Such as: CouchDB, MongoDb. There is also a document database SequoiaDB in China, which has been open sourced.
Typical application scenario: Web application (similar to Key-Value, Value is structured, the difference is that the database can understand the content of Value)
 Data model: key-value pair corresponding to Key-Value, Value is structured data
Advantages and disadvantages: The data structure requirements are not strict, the table structure is variable, and there is no need to pre-define the table structure like a relational database; the query performance is not high, and there is a lack of unified query syntax.


(4) Graph database
Unlike other row-column and rigid-structured SQL databases, a graph-structured database uses a flexible graph model and can be extended to multiple servers. NoSQL databases do not have a standard query language (SQL), so making database queries requires a data model. Many NoSQL databases have RESTful data interfaces or query APIs. Such as: Neo4J, InfoGrid, Infinite Graph.
典型应用场景:社交网络,推荐系统等。专注于构建关系图谱
 数据模型:图结构
优缺点: 利用图结构相关算法。比如最短路径寻址,N度关系查找等;很多时候需要对整个图做计算才能得出需要的信息,而且这种结构不太好做分布式的集群方案。


因此,我们总结NoSQL数据库在以下的这几种情况下比较适用:1、数据模型比较简单;2、需要灵活性更强的IT系统;3、对数据库性能要求较高;4、不需要高度的数据一致性;5、对于给定key,比较容易映射复杂值的环境。

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325648359&siteId=291194637