# NoSQL

**NoSQL**（通常展开为“不仅仅是SQL”）是不使用传统表格[关系模型](https://www.edgepedia.org/zh/relational-model)的一类数据库管理系统的统称。NoSQL系统不采用通过键连接规范化表的方式，而是将数据存储为键值对、类JSON文档、宽列或图，并且通常设计为可跨多台服务器横向扩展，同时放宽关系系统所提供的某些一致性保证。<sup>[1](https://aws.amazon.com/nosql/)</sup><sup> • </sup><sup>[2](https://research.spec.org/icpe_proceedings/2017/companion/p107.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 数据模型 | 四大类别：文档存储、列族存储、图存储和键值存储<sup>[2](https://research.spec.org/icpe_proceedings/2017/companion/p107.pdf)</sup> |
| 术语历史 | 1998年由卡洛·斯特罗齐（Carlo Strozzi）创造，用于指称其不使用SQL的关系数据库；2009年由埃里克·埃文斯（Eric Evans）在约翰·奥斯卡松（Johan Oskarsson）组织的一次聚会后重新引入，用于指称非关系数据库<sup>[3](https://www.doria.fi/bitstream/handle/10024/181533/bhowmick_pranoy_ranjan.pdf?sequence=2)</sup><sup> • </sup><sup>[4](https://bigdata-ir.com/wp-content/uploads/2017/04/NoSQL-Distilled.pdf)</sup> |
| 奠基系统 | 谷歌Bigtable（2006年）和亚马逊Dynamo（2007年），为PB级规模和高可用性而构建的分布式存储<sup>[5](https://research.google/pubs/bigtable-a-distributed-storage-system-for-structured-data/)</sup><sup> • </sup><sup>[6](https://www.amazon.science/publications/dynamo-amazons-highly-available-key-value-store)</sup> |
| 理论基础 | CAP定理（布鲁尔，2000年；吉尔伯特和林奇于2002年证明）限制分布式存储只能同时满足一致性、可用性和分区容错性中的两项<sup>[7](https://dspace.mit.edu/entities/publication/dfcb6512-af44-4fc9-8e8b-1a8f28f1b53a)</sup> |
| 基准测试发现 | 在针对结构化电影数据的四数据库比较中，Redis在写入、更新和删除方面最快，而MySQL在聚合函数方面表现最佳<sup>[8](https://www.benthamscience.com/article/107301)</sup> |
| 开发者使用情况 | 在2026年Stack Overflow调查中，20.5%的受访者报告大量使用Redis，11.4%使用MongoDB，3.8%使用Cassandra<sup>[9](https://survey.stackoverflow.co/2026/technology/data/da-database)</sup> |

## 历史

NoSQL一词最早出现于1998年，当时卡洛·斯特罗齐用它来命名其开源、轻量级且不需要SQL的关系数据库。该用法指的是关系系统，因此并非现代含义的起源。<sup>[3](https://www.doria.fi/bitstream/handle/10024/181533/bhowmick_pranoy_ranjan.pdf?sequence=2)</sup>

现代含义可追溯至2009年。当时在Last.fm工作的软件开发者约翰·奥斯卡松于2009年6月11日在旧金山组织了一次聚会，讨论Hypertable、HBase、Voldemort、Dynomite和[Cassandra](https://www.edgepedia.org/zh/apache-cassandra)等开源分布式非关系数据库。Rackspace的开发者埃里克·埃文斯建议使用NoSQL这个名称，据称是作为一个方便的Twitter话题标签，而非具有深意的术语。<sup>[4](https://bigdata-ir.com/wp-content/uploads/2017/04/NoSQL-Distilled.pdf)</sup><sup> • </sup><sup>[10](https://blog.knuthaugen.no/infrastructure/2010/03/16/a-brief-history-of-nosql.html)</sup>该名称迅速传播，到2012年NoSQL产品数量已超过120个。<sup>[11](https://www.networkworld.com/article/665327/tech-primers-a-vendor-independent-comparison-of-nosql-databases-cassandra-hbase-mongodb-riak.html)</sup>

技术基础早于名称的出现。谷歌的[Bigtable](https://www.edgepedia.org/zh/bigtable)于2006年被描述，是一个分布式存储系统，设计为可跨数千台商用服务器扩展至PB级数据，服务于从网络索引到[谷歌地球](https://www.edgepedia.org/zh/google-earth)等延迟要求各异的应用。<sup>[5](https://research.google/pubs/bigtable-a-distributed-storage-system-for-structured-data/)</sup>亚马逊的Dynamo于2007年发表，是一个高可用的键值存储，其构建目的是使购物车等核心服务即使在磁盘、网络或数据中心故障期间也能始终读写；为实现这种可用性，它在某些故障场景下牺牲一致性，采用对象版本管理和应用辅助的冲突解决机制。<sup>[6](https://www.amazon.science/publications/dynamo-amazons-highly-available-key-value-store)</sup>HBase、Cassandra和Riak等系统通常被描述为试图复制这两种设计所获成功的尝试。<sup>[12](https://teachmint.storage.googleapis.com/public/7266717832/StudyMaterial/cede62f1-62d0-459c-b42f-aebb2d65032b.pdf)</sup>

## 数据模型

NoSQL系统通常按其对外暴露的数据模型进行分组。<sup>[2](https://research.spec.org/icpe_proceedings/2017/companion/p107.pdf)</sup>

- **键值存储**将每条记录保存为由唯一键寻址的不透明值。它们是最简单的模型，适合缓存、会话数据和其他按标识符查找的场景。
- **文档存储**以基于JSON的文档层次化地保存数据和元数据；集合中的文档不必共享相同字段，同一字段的类型在不同文档之间也可以不同。<sup>[13](https://learn.microsoft.com/dotnet/architecture/cloud-native/relational-vs-nosql-data)</sup><sup> • </sup><sup>[14](https://www.mongodb.com/docs/manual/data-modeling/)</sup>MongoDB是最著名的例子。
- **宽列存储**将数据组织为列族，允许每行具有可变数量的列和多种数据类型；Cassandra和HBase遵循此模型。<sup>[15](https://docs.aws.amazon.com/whitepapers/latest/choosing-an-aws-nosql-database/types-of-nosql-databases.html)</sup>
- **图存储**将数据表示为节点、边和属性，用于社交网络和推荐引擎等高度连接的数据；Neo4j和亚马逊Neptune是例子。<sup>[15](https://docs.aws.amazon.com/whitepapers/latest/choosing-an-aws-nosql-database/types-of-nosql-databases.html)</sup><sup> • </sup><sup>[16](https://aws.amazon.com/nosql/graph/)</sup>

大多数NoSQL系统的一个决定性特征是灵活或无模式的数据模型，这与关系数据库中严格定义的表、列和引用完整性形成对比。<sup>[11](https://www.networkworld.com/article/665327/tech-primers-a-vendor-independent-comparison-of-nosql-databases-cassandra-hbase-mongodb-riak.html)</sup><sup> • </sup><sup>[1](https://aws.amazon.com/nosql/)</sup>这种灵活性改变了设计工作的方式：在关系系统中，开发者可以先规范化数据，之后再添加查询；而在DynamoDB等NoSQL系统中，模式是围绕应用已知的访问模式设计的，超出这些模式的查询可能代价高昂且速度缓慢。<sup>[17](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-general-nosql-design.html)</sup>

## 一致性与CAP定理

埃里克·布鲁尔于2000年提出了CAP权衡：分布式系统无法同时保证一致性、可用性和分区容错性。麻省理工学院的计算机科学家塞思·吉尔伯特和[南希·林奇](https://www.edgepedia.org/zh/nancy-lynch)于2002年证明了这一猜想，表明在网络分区一侧完成写入后，另一侧的读取必须要么返回过期数据，要么无法终止。<sup>[7](https://dspace.mit.edu/entities/publication/dfcb6512-af44-4fc9-8e8b-1a8f28f1b53a)</sup><sup> • </sup><sup>[18](https://datasystem.school/data-system-papers-distilled/papers/cap.html)</sup>

由于分区在真实网络中会发生，NoSQL数据库通常倾向于可用性而非严格一致性，这与大多数关系数据库形成对比。<sup>[19](https://link.springer.com/article/10.1186/s40537-015-0025-0)</sup>许多系统使这种权衡可调。Cassandra为读取和写入提供多种一致性级别，当选择“ALL”级别时接近ACID语义；MongoDB虽然常被归类为CP系统，但也提供类似选项。<sup>[19](https://link.springer.com/article/10.1186/s40537-015-0025-0)</sup>MongoDB支持三个部署级别的事务：独立节点上的单文档事务、副本集中的多文档事务以及分片集群中的分布式事务。<sup>[20](https://arxiv.org/abs/2111.14946)</sup>两种范式之间的界限也从另一个方向变得模糊：DocumentDB——一个在[PostgreSQL](https://www.edgepedia.org/zh/postgresql)上实现的MongoDB兼容API——于2025年在微软、AWS等支持下由Linux基金会以MIT许可证采纳。<sup>[21](https://www.techradar.com/pro/who-says-databases-are-boring-microsoft-google-and-aws-all-back-the-linux-foundations-move-to-add-documentdb)</sup>

## 实践中的性能

基准测试一致表明，相对性能取决于操作和工作负载，而非整个类别。在2021年对MySQL、MongoDB、Cassandra和Redis在IMDB电影模式上、数据集规模为1,000、10,000、25,000和50,000条记录的一项实证比较中，Redis在写入、更新和删除操作上给出了最佳的时间和内存结果，而MongoDB随着数据规模增长表现最差，归因于其锁定机制。MySQL在基本读写方面表现最差，但在聚合函数方面表现最佳，作者得出结论：对于基本读写操作，NoSQL优于SQL系统，而当查询主要涉及聚合时，SQL系统更好。<sup>[8](https://www.benthamscience.com/article/107301)</sup>一项对dbSNP数据库基因组注释的研究在该工作负载上发现了相反的方向：MongoDB和支持NoSQL的PostgreSQL在几乎所有操作中，在存储、索引和查询检索方面都优于普通MySQL。<sup>[22](https://pubmed.ncbi.nlm.nih.gov/27810480/)</sup>

比较测试本身存在方法论上的局限。由库珀及其同事提出的Yahoo!云服务基准（YCSB）成为测试NoSQL数据库读写性能、延迟和弹性的标准工具。<sup>[19](https://link.springer.com/article/10.1186/s40537-015-0025-0)</sup>于韦斯屈莱大学的托尼·泰帕卢斯（Toni Taipalus）对117项DBMS性能比较研究进行的2024年系统综述发现，性能测试通常以不反映真实用例的方式进行，且报告细节不足以复现或从所述结果中得出结论。<sup>[23](https://www.sciencedirect.com/science/article/pii/S0164121223002674)</sup>

## 采用情况

NoSQL存储被广泛与关系系统一起使用，而非取而代之。在Stack Overflow开发者调查的2026年技术数据中，12,061名受访者里，20.5%报告有大量Redis开发工作，11.4%有MongoDB，5.8%有DynamoDB，3.8%有Cassandra，而PostgreSQL为43.9%，MySQL为15.3%。<sup>[9](https://survey.stackoverflow.co/2026/technology/data/da-database)</sup>云厂商现在为每种模型提供托管版本，包括用于键值和文档访问的亚马逊DynamoDB、用于宽列工作负载的亚马逊Keyspaces以及用于图的亚马逊Neptune。<sup>[15](https://docs.aws.amazon.com/whitepapers/latest/choosing-an-aws-nosql-database/types-of-nosql-databases.html)</sup>

## References

1. [What is a NoSQL Database? Nonrelational Databases Explained, AWS](https://aws.amazon.com/nosql/)
2. [NoSQL databases categorised according to the supported data model, ICPE 2017 Companion Proceedings](https://research.spec.org/icpe_proceedings/2017/companion/p107.pdf)
3. [Pranoy Ranjan Bhowmick, Overview of NoSQL databases, University of Jyväskylä thesis](https://www.doria.fi/bitstream/handle/10024/181533/bhowmick_pranoy_ranjan.pdf?sequence=2)
4. [NoSQL Distilled, Pramod J. Sadalage and Martin Fowler](https://bigdata-ir.com/wp-content/uploads/2017/04/NoSQL-Distilled.pdf)
5. [Bigtable: A Distributed Storage System for Structured Data, Google Research](https://research.google/pubs/bigtable-a-distributed-storage-system-for-structured-data/)
6. [Dynamo: Amazon's highly available key-value store, Amazon Science](https://www.amazon.science/publications/dynamo-amazons-highly-available-key-value-store)
7. [Gilbert, Seth and Lynch, Nancy A. Perspectives on the CAP Theorem, Computer 45(2), 2012, MIT DSpace](https://dspace.mit.edu/entities/publication/dfcb6512-af44-4fc9-8e8b-1a8f28f1b53a)
8. [Kanchan, Shivangi; Kaur, Parmeet; Apoorva, Pranjal. Empirical Evaluation of NoSQL and Relational Database Systems, Recent Advances in Computer Science and Communications 14(8), 2021](https://www.benthamscience.com/article/107301)
9. [Databases, Technology data 2026, Stack Overflow Developer Survey](https://survey.stackoverflow.co/2026/technology/data/da-database)
10. [A Brief History of NoSQL, Knut Haugen](https://blog.knuthaugen.no/infrastructure/2010/03/16/a-brief-history-of-nosql.html)
11. [A vendor-independent comparison of NoSQL databases: Cassandra, HBase, MongoDB, Riak, Network World](https://www.networkworld.com/article/665327/tech-primers-a-vendor-independent-comparison-of-nosql-databases-cassandra-hbase-mongodb-riak.html)
12. [Professional NoSQL, study material copy](https://teachmint.storage.googleapis.com/public/7266717832/StudyMaterial/cede62f1-62d0-459c-b42f-aebb2d65032b.pdf)
13. [Relational vs. NoSQL data, Microsoft Learn](https://learn.microsoft.com/dotnet/architecture/cloud-native/relational-vs-nosql-data)
14. [Data Modeling in MongoDB, MongoDB Docs](https://www.mongodb.com/docs/manual/data-modeling/)
15. [Types of NoSQL databases, Choosing an AWS NoSQL Database whitepaper](https://docs.aws.amazon.com/whitepapers/latest/choosing-an-aws-nosql-database/types-of-nosql-databases.html)
16. [What Is a Graph Database? AWS](https://aws.amazon.com/nosql/graph/)
17. [NoSQL design for DynamoDB, Amazon DynamoDB Developer Guide](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-general-nosql-design.html)
18. [Brewer's Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services, Papers Distilled](https://datasystem.school/data-system-papers-distilled/papers/cap.html)
19. [Choosing the right NoSQL database for the job: a quality attribute evaluation, Journal of Big Data](https://link.springer.com/article/10.1186/s40537-015-0025-0)
20. [Verifying Transactional Consistency of MongoDB, arXiv](https://arxiv.org/abs/2111.14946)
21. [Microsoft, Google, and AWS back the Linux Foundation's move to add DocumentDB, TechRadar](https://www.techradar.com/pro/who-says-databases-are-boring-microsoft-google-and-aws-all-back-the-linux-foundations-move-to-add-documentdb)
22. [Evaluation of relational and NoSQL database architectures to manage genomic annotations, PubMed](https://pubmed.ncbi.nlm.nih.gov/27810480/)
23. [Taipalus, Toni. Database management system performance comparisons: A systematic literature review, Journal of Systems and Software 208, 2024](https://www.sciencedirect.com/science/article/pii/S0164121223002674)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026; Oct 25, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Databases and data systems › SQL and query languages › NoSQL query models

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/nosql

English original: https://www.edgepedia.org/nosql
