- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我刚刚开始研究 Amazon 的 DynamoDB。显然,可伸缩性很有吸引力,但我正试图摆脱 SQL 模式,进入非 SQL 模式。可以这样做吗(具有 dynamodb 的所有可扩展性优势):
有大量条目(比如 5 - 1000 万)由某个数字索引。每个条目中的一个字段将是创建日期。 dynamo db 是否有一种有效的方法可以为我的网络应用程序提供两个日期之间创建的所有条目?
一个更简单的问题 - dynamo db 可以给我所有字段匹配特定数字的条目吗?也就是说,将有另一个字段是数字,为了参数的缘故,让我们说在 0 到 10 之间。我可以要求 dynamodb 给我所有具有值的条目,例如6?
这两个查询是否都需要扫描整个数据集(我认为这是给定数据集大小的问题?)
非常感谢
最佳答案
Is there an effective way for dynamo db to give my web app all the entries created between two dates?
是的,请查看 Primary Key 的Amazon DynamoDB 数据模型 中的概念,特别是哈希和范围类型主键:
In this case, the primary key is made of two attributes. The first attributes is the hash attribute and the second one is the range attribute. Amazon DynamoDB builds an unordered hash index on the hash primary key attribute and a sorted range index on the range primary key attribute. [...]
列出的示例完全符合您的用例,即 Reply ( Id, ReplyDateTime, ... ) 表有助于使用 Hash and Range 类型的主键散列属性 Id 和范围属性 ReplyDateTime。
您将通过 Query 使用它API,请参阅 RangeKeyCondition 了解详细信息和 Querying Tables in Amazon DynamoDB对于各自的例子。
can dynamo db give me all entries in which a field matches a certain number. [...] Can I ask dynamodb to give me all the entries which have value e.g. 6?
这也是可能的,尽管是通过 Scan仅 API(即确实需要读取表中的每个项目),请参阅 ScanFilter 了解详细信息和 Scanning Tables in Amazon DynamoDB对于各自的例子。
Do both of these queries need a scan of the entire dataset (which I assume is a problem given the dataset size?)
如前所述,第一种方法使用查询,而第二种方法需要扫描,而且通常,查询操作比扫描操作更有效 - 这是一个很好的入门建议,尽管细节更复杂并且取决于您的用例,请参阅 Query and Scan in Amazon DynamoDB 中的扫描和查询性能部分概述:
For quicker response times, design your tables in a way that can use the Query, Get, or BatchGetItem APIs, instead. Or, design your application to use scan operations in a way that minimizes the impact on your table's request rate. For more information, see Provisioned Throughput Guidelines in Amazon DynamoDB.
因此,与往常一样,在应用 NoSQL 解决方案时,您可能需要调整架构以适应这些限制。
关于database - 从 DynamoDB 中获取值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9166306/
我们使用 Azure 弹性池,生成多个客户端数据库和一个引用客户端数据库的主数据库。 我们已经拥有多个数据库,并且正在开发新版本的代码。我们使用 EF6 代码优先。当我们对模型进行更改(添加属性)时,
我们使用 Azure 弹性池,生成多个客户端数据库和一个引用客户端数据库的主数据库。 我们已经拥有多个数据库,并且正在开发新版本的代码。我们使用 EF6 代码优先。当我们对模型进行更改(添加属性)时,
我希望将一些信息分发到不同的机器上,以便在没有任何网络开销的情况下实现高效和极快的访问。数据存在于关系模式中,实体之间的关系是“加入”的要求,但根本不是写入数据库的要求(它会离线生成)。 我非常相信
我使用 GrapheneDB 来托管我的 neo4j 数据库 (db)。 问题 我有 N客户并且正在寻找自动分离他们的内容(他们独特的数据库)的方法,以便: 它不重叠数据 操作速度不受影响。 选项 1
当服务器开始工作(Tomcat)时,日志显示此错误: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid b
我在 Oracle 数据库实例中按以下方式创建了一个触发器。 CREATE OR REPLACE TRIGGER after_logon_on_database AFTER LOGON ON DATA
原谅我的无知,我是数据库约定的初学者。 这是我的 SQLite 代码:(由我的数据库浏览器自动生成) CREATE TABLE `ResearchItems` ( `ID` INTEGER NO
是的是的是的,我已经在整个互联网上搜索过这个问题。一些结果发现,甚至来自 Stackoverflow。但是他们中的大多数人说“你应该自动加载数据库”,或者“parent::__construct();
我正在创建一个 Mac 应用程序,它将一些数据保存到 SQLite 数据库中。问题是:当我关闭数据库并再次打开时,数据不存在了。这是我的代码: NSString *sql = [NSString st
我正在建立一个网站,我打算发布各种帖子,比如教程、文章等。我打算用 php 来管理它,但是当涉及到存储每个帖子的内容时,将要显示的文本,更好的选择是:使用单独的文本文件还是将其添加为数据库中的每个条目
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 3 年前。 Improve this qu
对不起,这个关键字对我来说没有任何意义...有人可以给我一个定义吗? 提前致谢... 最佳答案 这是一个品牌。 http://pervasive.com/这是他们的数据库产品的链接 http://ww
我已经在 docker 版本 1.10.1 的 docker 镜像中安装了 PostgreSQL 9.4.6。根据这张官方图片: https://github.com/docker-library/p
当我的 android 应用程序尝试读取 android 短信数据库时,我遇到了这个崩溃。读取android短信数据库的代码类似于下面的代码 fragment : String SMS_URI = "
我有一个 public kit repo,我推送了 v1.0.3 并具有以下结构 go -database --database.go --go.mod --go.sum 我需要它 require g
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 9 年前。 Improve this qu
我们正在使用MySQL数据库在Go中创建一个Web应用程序。我们的用户一次只能拥有一个活跃的客户端。就像Spotify一样,您一次只能在一台设备上听音乐。为此,我制作了一个映射,将用户ID和作为其值的
我已经尝试在 PostgreSQL 中创建数据库好几天了,遇到了几个问题,但似乎卡住了。 我在 PostgreSQL 中手动创建了一个名为 postgres_development 的数据库,因为 b
我正在创建一个 iMessage 应用程序,它需要连接到与我的常规应用程序相同的数据库。 我调用 FirebaseApp.configure() 并对用户进行身份验证,但出于某种原因,在所有 Data
就像std::unordered_map但所有数据都应存储在磁盘上而不是内存中。 按照我的理解,应该做两部分:索引和存储。我已经学习了一些关于索引的数据结构,比如 Linear-Hash 或 B-Tr
我是一名优秀的程序员,十分优秀!