nosql数据库是什么_什么是NoSQL数据库?

nosql数据库是什么

Most of you have already heard of the term NoSQL Database and when you try to do a Google search of it, it’s not really clear in terms of what exactly this entire concept is. In this tutorial, we’re going to discuss the different aspects of the NoSQL databases and what makes them different from the regular relational databases that we’ve been using for years. 

你们中的大多数人都已经听说过NoSQL数据库这个词,当您尝试对其进行Google搜索时,就整个概念到底是什么还不清楚。 在本教程中,我们将讨论NoSQL数据库的不同方面,以及它们与我们已经使用多年的常规关系数据库的不同之处。

We’ll also go over the advantages and disadvantages of using the NoSQL database over a relational model. Let’s begin. 

我们还将介绍在关系模型上使用NoSQL数据库的优缺点。 让我们开始。

什么是关系数据库模型? (What is a Relational Database Model?)

Now, to understand what the NoSQL concept is and why we need it, we’ve to go back in time where only the relational database model existed. Relational database models have been a result of years of hard work and best practices and stress testing that has been tried and tested on millions of websites until now.

现在,要了解NoSQL的概念以及我们为什么需要它,我们必须回到只有关系数据库模型存在的时间。 关系数据库模型是经过数年的努力,最佳实践和压力测试的结果,迄今为止,该数据库已经在数百万个网站上进行了尝试和测试。

They’re designed for reliable transactions and proper structure of data that needs to be stored in them. But because of the structure and the expectation of the kind of data that can be accepted by traditional SQL databases or Relational Databases, there are a lot of limitations that come along with it. We’ll discuss these limitations compared to the NoSQL model in a while.

它们旨在实现可靠的交易和需要存储在其中的数据的正确结构。 但是由于传统SQL数据库或关系数据库可以接受的数据的结构和期望,因此存在很多限制。 与NoSQL模型相比,我们将在一段时间内讨论这些限制。

So even though the Relational Database Model still works for most of the sites in the world which do not really need to handle a lot of data, larger websites cannot rely on this model anymore. Enter NoSQL, a non-relational database where the data is stored in a non-tabular format, unlike the traditional database models.

因此,即使关系数据库模型仍然适用于世界上大多数不需要处理大量数据的网站,大型网站也不再能够依赖此模型。 输入NoSQL,这是一个非关系数据库,其中的数据以非表格格式存储,这与传统的数据库模型不同。

什么是NoSQL? (What is NoSQL?)

As appropriately named, the NoSQL database model works in a way that’s not peculiar to SQL databases. How does the NoSQL database store data if it’s not tabular? There are different types of NoSQL databases where the data is stored in different ways. 

顾名思义,NoSQL数据库模型的工作方式并非SQL数据库所特有。 如果数据不是表格格式,NoSQL数据库如何存储数据? 有不同类型的NoSQL数据库,其中数据以不同的方式存储。

The most common layouts are:

最常见的布局是:

  • Wide-column

    宽列
  • Document 

    文件
  • Key-Value

    核心价值
  • Graph

    图形

Scroll to the bottom of the article of a summarized graph of the different types of layouts, and NoSQL databases for the same

滚动到不同类型的布局和NoSQL数据库的摘要图的摘要图的底部

NoSQL简史 (Brief History of NoSQL)

NoSQL is not a new occurrence in the world of software technology. They’ve been in existence since 1998 when the term was first coined by Carlo Strozzi. He created one of the first database systems that did not use the SQL language. 

NoSQL在软件技术领域并不是新生事物。 自1998年这个术语由Carlo Strozzi首次提出以来,它们就一直存在。 他创建了第一个不使用SQL语言的数据库系统。

But the database model did not pick up until 2008 when the need for high-velocity data handling started showing up. Larger companies like Google, Facebook, Amazon, etc started leveraging this database to handle their high volume data using the NoSQL databases.

但是直到2008年开始出现对高速数据处理的需求时,数据库模型才开始兴起。 较大的公司,例如Google,Facebook,Amazon等,开始利用此数据库使用NoSQL数据库处理其大量数据。

NoSQL Popularity
NoSQL Popularity
NoSQL流行度

As you can see, the trend picked up in the late 2008s and has continued since then. 

如您所见,这种趋势在2008年代后期开始回升,并且从那时起一直持续。

Let’s discuss the common database types in a little more detail.

让我们更详细地讨论常见的数据库类型。

1. NoSQL宽列布局 (1. NoSQL Wide-Column Layout)

This layout of NoSQL stores data in a very similar fashion to that of a relational database model, i.e., in a tabular format. But what differentiates a Wide-Column layout from the relational model’s tabular layout is that each row can have a different set of columns in a wide column layout. 

NoSQL的这种布局以与关系数据库模型非常类似的方式(即以表格格式)存储数据。 但是,宽列布局与关系模型的表格布局的区别在于,每一行在宽列布局中可以具有一组不同的列。

Now, this might sound complicated at first but it’s really not. Instead of having a fixed column set and a variable number of rows, we can have a variable number of rows as well as columns. Even though this might sound complicated at first for a person who has always used the relational database model, it can be displayed in just one illustration.

现在,一开始听起来可能很复杂,但实际上并非如此。 代替固定的列集和可变的行数,我们可以具有可变的行数和列数。 即使对于一向一直使用关系数据库模型的人来说,乍一看这可能听起来很复杂,但它只能以一个插图显示。

Wide Column Layout
Wide Column Layout
宽列布局

Use Cases:

用例:

  • IoT related data storage

    物联网相关数据存储
  • Reporting systems

    报告系统
  • Logging 

    记录中
  • TS Data

    TS数据

Databases:

数据库:

  • Amazon DynamoDB 

    亚马逊DynamoDB
  • Bigtable

    大表
  • Cassandra

    卡桑德拉
  • Scylla

    希拉
  • HBase

    HBase的
  • Hypertable

    超表

2. NoSQL文档布局 (2. NoSQL Document Layout)

Now that you know what the wide-column layout is, let’s move to the next, commonly used NoSQL database layout which is the document layout. In conceptual terms, the document layout is really simple. The database stores data in the form of documents in a standard format or with the use of encodings such as JSON, XML, YAML, etc.

现在您知道宽列布局是什么,让我们转到下一个常用的NoSQL数据库布局即文档布局。 从概念上讲,文档的布局非常简单。 数据库以标准格式或使用JSON,XML,YAML等编码的文档形式存储数据。

The benefit of using a document layout model is that we can store any type of data within the database. Another benefit of using the NoSQL document layout model is that there are no empty “columns” or variables within the files. Only the required information is stored and the document is closed for retrieval by the database.

使用文档布局模型的好处是我们可以在数据库中存储任何类型的数据。 使用NoSQL文档布局模型的另一个好处是文件中没有空的“列”或变量。 仅存储所需的信息,并且关闭文档以供数据库检索。

Each document is stored with a key and the databases also provide methods for organizing the files in question. Also, the databases provide the users with mechanisms to retrieve and manipulate the data within the documents. It could be a way to either edit existing documents or completely replace the documents.

每个文档都存储有一个密钥,数据库还提供了用于组织相关文件的方法。 同样,数据库为用户提供了检索和处理文档中数据的机制。 它可能是编辑现有文档或完全替换文档的一种方式。

Use cases:

用例:

  • Content Management and Monitoring systems

    内容管理和监控系统
  • Web and mobile applications

    网络和移动应用

Databases:

数据库:

  • ArangoDB 

    ArangoDB
  • BaseX

    BaseX
  • Clusterpoint

    集群点
  • Couchbase

    Couchbase
  • CouchDB

    CouchDB
  • Etc..

    等等..

3. NoSQL键值布局 (3. NoSQL Key-Value Layout )

This is a simple model that pairs a unique key with a value that can be retrieved with the key. The data structure that is used in the key-value database layout is commonly known as a dictionary or hash table. 

这是一个简单的模型,将唯一键与可以通过该键检索的值配对。 键值数据库布局中使用的数据结构通常称为字典或哈希表。

When compared to RDBMS where the data structure is fixed, with Key-value layout, you have the flexibility to use any type of value and key pairs. Here’s a quick illustration of what a key-value pair looks like.

与通过键值布局固定数据结构的RDBMS相比,您可以灵活地使用任何类型的值和键对。 这是一个键-值对的外观的快速说明。

Key Value Database
Key-Value Database
关键值数据库

Use Cases:

用例:

  • Storing clickstream data

    存储点击流数据
  • Application logging

    应用日志

Databases:

数据库:

  • ArangoDB 

    ArangoDB
  • Aerospike

    气钉
  • Couchbase

    Couchbase
  • Redis

    雷迪斯

4. NoSQL图形布局 (4. NoSQL Graph Layout)

Graph layout databases are used for data that can be easily represented as related to other bits of data. Each node of the graph database represents an entity which could be a person, place, category, etc. Connecting these nodes is a relationship. For example, fruits could be apples or oranges. Apples are a “type of” fruit. 

图形布局数据库用于可轻松表示为与其他数据位相关的数据。 图形数据库的每个节点代表一个实体,该实体可以是人,地点,类别等。连接这些节点是一种关系。 例如,水果可以是苹果或橙子。 苹果是一种“水果”。

In a graph database, the above example can be represented as:

在图形数据库中,以上示例可以表示为:

Graph Database
Graph Database
图数据库

As you can see, this is a very simple model in representation but offers a lot of benefits in comparison to RDBMS for modern data.

如您所见,这是一个非常简单的表示模型,但是与RDBMS用于现代数据相比,它提供了很多好处。

Use Cases:

用例:

  • Recommendation Systems

    推荐系统
  • Geospatial Databases

    地理空间数据库

Databases:

数据库:

  • Amazon Neptune

    亚马逊海王星
  • DEX/Sparksee 

    DEX / Sparksee
  • Neo4j

    Neo4j
  • Sqrrl Enterprise

    Sqrrl企业

NoSQL与SQL关系数据库–选择哪个? (NoSQL vs SQL Relational Databases – Which one to choose?)

When working with databases and choosing the right one, you have to take into account what your application really needs. If you have an application that works with a limited amount of data that is structured an arrives in a specific format, you have no reason to add the complexity of a NoSQL database to your existing systems.

在使用数据库并选择合适的数据库时,必须考虑到应用程序的真正需求。 如果您的应用程序只能处理有限数量的结构化数据,并且采用特定格式,则您没有理由将NoSQL数据库的复杂性添加到现有系统中。

But if you’re developing an app that could now, or in future, work with variable data that comes rapidly at a high velocity, it’s best to develop your app with a NoSQL database.

但是,如果您正在开发的应用程序现在或将来可以使用高速变化的可变数据,那么最好使用NoSQL数据库开发应用程序。

NoSQL DatabasesTraditional SQL Databases
Works with variable dataRequires data to be in a structured format
Can handle large volumes of rapidly changing dataCan handle considerably large volumes of similar data
Horizontal Scalability – Can scale across systems and serversVertical Scalability – Can scale better as the allocated system resources are increased
Designed with low-cost hardware in mindDesigned with high-performance hardware in mind
NoSQL数据库 传统SQL数据库
处理可变数据 要求数据采用结构化格式
可以处理大量快速变化的数据 可以处理大量相似数据
水平可扩展性–可以跨系统和服务器扩展 垂直可扩展性–随着分配的系统资源的增加,可以更好地扩展
设计时考虑了低成本硬件 设计时考虑了高性能硬件

不同NoSQL数据库类型的摘要列表 (Summarized List of the Different NoSQL Database Types)

TypeNotable examples of this type
Key-Value CacheApache Ignite, Couchbase, Coherence, eXtreme Scale, Hazelcast, Infinispan, Memcached, Redis, Velocity
Key-Value StoreArangoDB, Aerospike, Couchbase, Redis
Key-Value Store (Eventually-Consistent)Oracle NoSQL Database, Dynamo, Riak, Voldemort
Key-Value Store (Ordered)FoundationDB, InfinityDB, LMDB, MemcacheDB
Tuple StoreApache River, GigaSpaces
Object DatabaseObjectivity/DB, Perst, ZopeDB
Document StoreArangoDB, BaseX, Clusterpoint, Couchbase, CouchDB, DocumentDB, eXist-db, IBM Domino, MarkLogic, MongoDB, Qizx, RethinkDB, Elasticsearch
Wide Column StoreAmazon DynamoDB, Bigtable, Cassandra, Scylla, HBase, Hypertable
Native Multi-model DatabaseArangoDB, Cosmos DB, OrientDB, MarkLogic
Graph DatabaseAmazon Neptune, DEX/Sparksee, Neo4j, Sqrrl Enterprise
类型 这种类型的著名例子
键值缓存 Apache Ignite,Couchbase,Coherence,eXtreme Scale,Hazelcast,Infinispan,Memcached,Redis,Velocity
键值存储 ArangoDB,Aerospike,Couchbase,Redis
键值存储(最终一致) Oracle NoSQL数据库,Dynamo,Riak,Voldemort
键值存储(已订购) FoundationDB,InfinityDB,LMDB,MemcacheDB
元组商店 阿帕奇河,GigaSpaces
对象数据库 客观性/数据库,Perst,ZopeDB
文件存储 ArangoDB,BaseX,Clusterpoint,Couchbase,CouchDB,DocumentDB,eXist-db,IBM Domino,MarkLogic,MongoDB,Qizx,RethinkDB,Elasticsearch
宽列存储 Amazon DynamoDB,Bigtable,Cassandra,Sylla,HBase,Hypertable
本机多模型数据库 ArangoDB,Cosmos DB,OrientDB,MarkLogic
图数据库 Amazon Neptune,DEX / Sparksee,Neo4j,Sqrrl Enterprise

Source: Table from Wikipedia NoSQL Page

资料来源Wikipedia NoSQL页面上的表格

结论 (Conclusion)

We hope that this post has helped you understand NoSQL better and has also cleared any questions that you might have had in your mind. NoSQL and non-relational database models are the modern way of handling data and will become a commonplace even in regular businesses in the coming future. 

我们希望这篇文章可以帮助您更好地理解NoSQL,并清除您可能想到的任何问题。 NoSQL和非关系数据库模型是处理数据的现代方法,并且即使在未来的将来,在常规业务中也将变得司空见惯。

So it’s a good idea to get yourself well-versed with the new model of data storage for your own future prospects. 

因此,让自己熟悉新的数据存储模型是一个不错的主意,以适合您自己的未来前景。

One thing to keep in mind is that even though NoSQL provides a lot of advantages over traditional databases, it comes with its own limitations which are out of scope for this topic at present. But do let us know if you have any questions in mind by commenting below.

要记住的一件事是,尽管NoSQL提供了优于传统数据库的许多优势,但它也有其自身的局限性,目前这些局限性已超出了范围。 但请在下方评论,让我们知道您是否有任何疑问。

翻译自: https://www.journaldev.com/36476/what-is-nosql-database

nosql数据库是什么

  • 2
    点赞
  • 33
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值