“面向文档"是什么意思?在谈论 MongoDB 和 Cassandra 时,vs. 键值是什么意思? [英] What does "Document-oriented" vs. Key-Value mean when talking about MongoDB vs Cassandra?

查看:22
本文介绍了“面向文档"是什么意思?在谈论 MongoDB 和 Cassandra 时,vs. 键值是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与 KV 存储相比,基于文档的 NoSQL 选项会给您带来什么好处,反之亦然?

What does going with a document based NoSQL option buy you over a KV store, and vice-versa?

推荐答案

key-value store 提供了最简单的数据模型,顾名思义:它是一个存储值的存储系统由一个键索引.您只能通过键进行查询,并且值是不透明,商店对它们一无所知任何.这允许非常快速的读写操作(简单的磁盘访问),我将此模型视为一种非易失性缓存(即非常适合您需要通过密钥快速访问长期存在的数据).

A key-value store provides the simplest possible data model and is exactly what the name suggests: it's a storage system that stores values indexed by a key. You're limited to query by key and the values are opaque, the store doesn't know anything about them. This allows very fast read and write operations (a simple disk access) and I see this model as a kind of non volatile cache (i.e. well suited if you need fast accesses by key to long-lived data).

面向文档的数据库扩展了先前的模型,并且值以数据库可以理解的结构化格式(文档,因此得名)存储.例如,文档可以是博客文章评论以非规范化方式存储的标签.由于数据是透明的,存储可以做更多的工作(如索引文档的字段),并且您不限于按键查询.正如我所暗示的,此类数据库允许通过单个查询获取整个页面的数据,并且非常适合面向内容的应用程序(这就是 Facebook 或 Amazon 等大型网站喜欢它们的原因).

A document-oriented database extends the previous model and values are stored in a structured format (a document, hence the name) that the database can understand. For example, a document could be a blog post and the comments and the tags stored in a denormalized way. Since the data are transparent, the store can do more work (like indexing fields of the document) and you're not limited to query by key. As I hinted, such databases allows to fetch an entire page's data with a single query and are well suited for content oriented applications (which is why big sites like Facebook or Amazon like them).

其他类型的 NoSQL 数据库包括面向列的存储图形数据库甚至对象数据库.但这超出了问题范围.

Other kinds of NoSQL databases include column-oriented stores, graph databases and even object databases. But this goes beyond the question.

这篇关于“面向文档"是什么意思?在谈论 MongoDB 和 Cassandra 时,vs. 键值是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆