我正在大量使用 Dynamo DB 来处理我正在构建的服务。一个新的客户端请求进来了,需要云搜索。我看到可以通过 AWS 控制台从发电机表创建云搜索域。
我的问题是这样的:
Is there a way to automatically offload data from a dynamo table into a cloud search domain via the API or otherwise at a specified time interval?
我更喜欢手动将 dynamo 文档卸载到 cloudsearch。非常感谢所有帮助!
最佳答案
这里有两个想法。
在 http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-dynamodb-data.html 的“将搜索域与 DynamoDB 表同步”部分中非常详尽地描述了这种方法。 .
缺点是这听起来很痛苦:您必须重新创建新的搜索域或维护更新表才能同步,并且您需要一个 cron 作业或其他东西来执行脚本。
使用新的 Lambdas 事件处理服务。基于 Dynamo 设置事件流非常简单(参见 http://docs.aws.amazon.com/lambda/latest/dg/wt-ddb.html)。
然后,您的 Lambda 将根据 Dynamo 事件向 CloudSearch 提交搜索文档。有关从 Lambda 提交文档的示例,请参阅 https://gist.github.com/fzakaria/4f93a8dbf483695fb7d5
在我看来,这种方法要好得多,因为它会不断更新您的搜索索引,而无需您的任何参与。
关于amazon-web-services - 自动将 dynamodb 表卸载到 cloudsearch 域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30202956/