- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
AWS DynamoDB 文档包含一个示例 schema for a forum .然而,这个模式能够回答的问题数量似乎很少。此外,该表似乎存在热键问题(大量回复备份在同一分区上)。
在题为“Amazon DynamoDB 的高级设计模式”的演讲中,主持人 around 43 minutes breaks down来自 Audible 的复杂用例,仅使用具有 3 个 GSI(索引)的单个表。
我正尝试从标准 RDBMS 3NF 背景中学习正确的 DynamoDB 建模。如何设计论坛以防止热分区,同时仍然满足这些常见用例?
查询:
基本架构(?):
- Forum: Partition key: Forum_GUID. Attributes: Name, Desc
- User: Partition key: User_GUID. Attributes: email, join_date
- Thread: Composite key: Forum_GUID, Topic_GUID. Attributes: posted_by, date, votes, body, subject
- Reply: Composite key: Topic_GUID, Reply_GUID. Attributes: posted_by, date, votes, body
我假设有多种解决方案(包括使用单个表)。我正在寻找任何可以解决此问题的答案,同时提供有关何时以及如何解决 properly use indexes 的指导。扩展应用程序的写入。
最佳答案
您可以使用上述模式。现在为您查询
按论坛主题(按发布日期或最近回复排序)
Select from GSI1 where GSI1 pk=Forum123 and sortby GSI1 SK
您可以根据经常询问的用例选择将谁保留在 GSI1 Sk 最近的回复/发布日期中。
按主题回复(按发布日期分页排序)
Select where pk=topic and sk startswith reply and sortby sk
用户回复(按发布日期排序)
Select from GSI2 where pk=User123 and sk startswith reply and sortby sk
按用户分类的主题(按发布日期排序)
Select from GSI2 where pk=User123 and sk startswith topic and sortby sk
得票最多的主题
This will require another GSI if you want to do this operation across multiple forums. but This GSI will certainly suffer from hot key issue. since there will be only one key. Instead of doing that, you can keep one fixed key value in your table who keeps these counts. and these values are updated by an async process.
关于database - 如何在没有热分区的情况下使用 Amazon DynamoDB 为论坛建模?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55340000/
我目前正在使用 php 和 sql 创建一个论坛。我的问题是如何将主题按正确的顺序排列,假设每页总共有 200 和 15 个主题,而我在第 10 页上。 我无法选择每个 ID,因为如果有人将时间戳发布
Closed. This question does not meet Stack Overflow guidelines。它当前不接受答案。 想要改善这个问题吗?更新问题,以便将其作为on-topi
基本上,我正在为 Intranet 编写一个小型论坛脚本。 我有 3 个用于论坛的 mysql (MySQLi) 表: forum_answer - 保存回复forum_quest - 持有第一个帖子
我正在尝试实现 django-registration-redux 并使用了由 Andres 编写的模板,网址为 https://github.com/macdhuibh/django-registr
我正在开发一个讨论论坛网站。当您打开论坛时,网络服务会获取所有活跃的帖子。 标题、评论数、近期事件(最新评论的日期)、发布者、状态。 除最近的事件外,我能够获取上述所有数据。 SELECT `po
我有一个使用 phpBB 的论坛。现在我想从源代码做这样的事情: 登录(“用户”,“密码”) 如何在 phpBB 中执行此操作? 最佳答案 首先你需要为 phpBB 引导: define('IN_PH
我想知道检测人们在我的论坛上提交帖子时使用的字母表的最佳方法(对博客也很有用)。事情是最近我收到了很多西里尔字母、希腊字母和日语的垃圾邮件,所以由于我的论坛是为讲法语和英语的人准备的,所以我想防止垃圾
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
所以我几年前创建了这个 vBulletin 论坛,几个月前它开始时不时地通过电子邮件向我发送错误消息。由于我在创建网站时注册为论坛管理员,现在当出现错误时它会向我发送电子邮件。网站所有者和我聚在一起,
我很难在不同的 php 论坛之间进行选择。我正在寻找一个轻量级、安全且易于定制的论坛。 谷歌搜索给我提供了几十个由个人制作的“简单的 php 论坛”,但我正在寻找一个基于社区的论坛。因为,你知道,帮助
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 12 年前。 Improve thi
我一直在寻找新的论坛软件(线程)或公告板(平面/分区)。我想知道是否有基于大型 PHP 框架之一的实现(CodeIgniter、Kohana、Yii、CakePHP、ZF、Seagull、Fusebo
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 10 年前。 Improve thi
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 7 年前。
我知道这个问题已经在这里问过几次了,但没有一个答案让我满意。这是因为几乎所有这些都涉及与数据库相关的巨大读/写过程,我想不惜一切代价避免。 关于未读的讨论/主题/帖子,有很多事情要考虑。不知道MyBB
我被指派在我们已经使用了一段时间的内部 CMS 中添加一个论坛。该系统有自己的登录/用户系统和已建立的用户数据库。理想情况下,我会寻找最简单的论坛软件来转换为与我们的系统一起使用,但如果有必要,可以重
已结束。此问题正在寻求书籍、工具、软件库等的推荐。它不满足Stack Overflow guidelines 。目前不接受答案。 我们不允许提出寻求书籍、工具、软件库等推荐的问题。您可以编辑问题,以便
我的表单有一个不寻常的问题(这里是精简版): (function($){ $("form").submit(function(){ alert('Ch
作为我论文论文的一部分,我构建了一个“机器人”,它会抓取 C 语言编程类(class)的官方论坛并搜索常见问题以便发布回复。我现在必须模拟登录才能发布适当的回复。登录表单如下: !-- 登录表单 --
我正在尝试创建一个在后台运行的小脚本,并检查论坛上是否有新消息(使用 phpBB3)。由于许多子论坛需要登录用户的权限才能查看,因此我创建了一个脚本,该脚本会向服务器发送后请求以先登录。 该脚本目前已
我是一名优秀的程序员,十分优秀!