什么是“文档数据存储”和“键值数据存储”? [英] What is 'document data store' and 'key-value data store'?

查看:255
本文介绍了什么是“文档数据存储”和“键值数据存储”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是文档数据存储?什么是键值数据存储?

What is document data store? What is key-value data store?

请用非常简单的一般词语描述每个键值对的机制。 p>

Please, describe in very simple and general words the mechanisms which stand behind each of them.

推荐答案

在文档数据存储中,每个记录都有多个字段,类似于关系数据库。

In a document data store each record has multiple fields, similar to a relational database. It also has secondary indexes.

示例记录:

"id" => 12345,
"name" => "Fred",
"age" => 20,
"email" => "fred@example.com"

然后您可以按ID,姓名,年龄或电子邮件进行查询。

Then you could query by id, name, age, or email.

键/值存储更像是一个大的哈希表,而不是传统的数据库:每个键对应一个值,看起来一个键是唯一的方式访问记录。

A key/value store is more like a big hash table than a traditional database: each key corresponds with a value and looking things up by that one key is the only way to access a record. This means it's much simpler and often faster, but it's difficult to use for complex data.

示例记录:

12345 => "Fred,fred@example.com,20"

您的查询条件只能使用12345。您无法查询姓名,电子邮件或年龄。

You can only use 12345 for your query criteria. You can't query for name, email, or age.

这篇关于什么是“文档数据存储”和“键值数据存储”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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