NoSQL Introduction

A, NoSQL Introduction

NoSQL (Not only SQL) database, can be understood as different from relational databases such as mysql, oracle and other non-relational database.

 

Talk to NoSQL must mention the famous CAP theory, the full name of Consistency Available and Partition tolerance, namely consistency (C), availability (A) and partitions fault tolerance (P), which is proposed by Professor Eric Brewer distributed system design, and gives the conclusion: any distributed system can only meet in which two points, three can not do both. This theory can be said to be the cornerstone of NoSQL databases, NoSQL has also called a flourishing field, and we have no what a NoSQL taking into account the characteristics of these three points.

NoSQL must make trade-offs between consistency, availability and fault tolerance partition, now, almost all of the NoSQL are selected to maintain consistency in the availability or fault tolerance on the basis of partition, such as HBase is sacrificed in exchange for partial availability the complete consistency, Cassandra and HBase like it is at the expense of strong consistency in exchange for a guarantee of availability.

Two, NoSQL scenarios

NoSQL as the implementation of distributed systems, mass data permanently stored, unstructured data storage, ultra-efficient large-scale data read and write, superior level of scalability, etc. These features make NoSQL has been widely used.

Third, the lack of NoSQL place

Transaction support, associated features, and even a SQL query, which is short board NoSQL, but also determines the NoSQL yet it can not replace relational databases.

Four, NoSQL classification

Normally, we will press NoSQL divided into four categories functional properties, i.e. the key type, column-oriented aromatic storage, document type, and FIG databases, refer to the following table:

 

Types of

Feature

application

Case

Key type

A simple form of data storage, accessed by key value

Image storage

Redis

MemcacheDB

Berkeley DB

You can quickly check to its value through key

File system based on key

In general, regardless of value storage format to inherit

Designed to be extensible system

Column family

Sparse matrix storage format, through the ranks as a key

Web Crawler result storage

Hbase

Cassandra

Accumulation

Convenience store structured and semi-structured data

Big Data Interactive Query

Data compression provides convenient data query IO Advantage

Soft consistency

Document type

Hierarchical data structure stored in the form of speaking

Document Search

MongoDB

CouchDB

Couchbase

Document storage is generally used to store similar json format

Internet Content Management

Indexing of some fields in order to achieve some of the features of the relational database

Highly variable data

Map storage

For high correlation requires problem

Social network

Neo4j

FlockDB

InfiniteGraph

Best store graphics relations

Fraud Detection

A traditional relational database to solve the case of poor performance, design and inconvenient to use

Strong associated data

Fifth, introduce common NoSQL

The following four NoSQL is the most commonly used:

  • Redis: Based on memory, supports persistent key-value database

  • HBase: column-oriented, NoSQL efficient random access is

  • Cassandra: column-oriented, write-optimized NoSQL

  • MongoDB: query efficiency, supports multi-document database index.

 

 

1, repeat:

 

Redis is a high-performance, Key-Value of NoSQL databases, memory access, support for persistent disks, supports a variety of data structures and algorithms (string, hash, list, set, zset, Bitmaps, HyperLogLog, etc.). The main application in the cache scenario.

 

main feature:

  • high performance

  • Pure memory access (non-synchronous data without reading the disk)

  • Single-threaded

  • Non-blocking multi-channel IO multiplexing

 

2、HBase:

 

HBase is a distributed, column-oriented NoSQL database is open source implementation of Google Bigtable, the underlying storage based on HDFS, MapReduce computation native support framework. The main application scenarios in mass data storage, ultra-large-scale random read and write access.

 

main feature:

  • Random read and write access

  • Distributed, column-oriented

  • Strong consistency

  • On the underlying data store HDFS

 

3、Cassandra:

 

Cassandra is a distributed, no center, flexible and scalable NoSQL database, based on Amazon Dynamo distributed design and Google Bigtable data model. Cassandra is excellent write throughput to do a special optimized, it is often used in read-write is greater than the scene.

 

main feature:

  • Distributed, decentralized

  • Elastic scalability

  • Adjustable consistency (consistency level)

  • high performance

 

4、MongoDB:

 

MongoDB is a distributed, document-oriented NoSQL database for large-capacity data storage, providing a unified data format (bson), supports different types of indexes. For storing object or Json data format, the pursuit of high-performance business scenarios.

 

main feature:

  • Document-oriented, very flexible

  • It supports various types of indexes

  • Replication failover and high availability

  • Automatic sheet, easy to expand

     

This article introduces the basic concepts of NoSQL, CAP theory, NoSQL classification to highlight the large data store frequently-used several NoSQL databases, including basic concepts, usage scenarios, the main features.

 

【转】https://mp.weixin.qq.com/s/0LtaqbQl__u4PbiKs5iz5A

Guess you like

Origin www.cnblogs.com/zhangzhijian/p/11235954.html