每X秒自动通过URL检索JSON数据,并存储在Amazon DynamoDB中 [英] Automatically retrieve JSON data via URL every X second and store in Amazon DynamoDB

查看:346
本文介绍了每X秒自动通过URL检索JSON数据,并存储在Amazon DynamoDB中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种简单的方法来在Amazon DynamoDB中检索和存储JSON。
我通过一个URL获取数据,我想每X秒查询一个URL - 例如:
wget http://open-stocks.com/api/get-data-10:21:33.json



URL中的时间应该与请求的时间匹配 - 这是动态的。



我想我可以启动整个Linux服务器AWS并编写一个Python脚本生成URL,获取数据并将其推送到Amazon DynamoDB - 但我会喜欢一种现有的服务,这使我不担心服务器操作系统,cronjobs等...

$ b

解决方案

AWS Lambda现在支持< a href =http://stackoverflow.com/questions/27382009/aws-lambda-scheduled-tasks>预定任务。由于Lambda 可以发出HTTP请求和< a href =https://gist.github.com/markusklems/1e7218d76d7583f1f7b3>写入DynamoDB ,使用Lambda应该工作,你不必担心设置EC2实例与cron作业


I'm looking for an easy way to retrieve and store JSON in Amazon DynamoDB. I'm getting the data via an URL and I would like to query the URL every X second - example: wget http://open-stocks.com/api/get-data-10:21:33.json

The time in the URL should match time of request - so that's dynamic.

I guess I could spin up an entire Linux server on AWS and write a Python script generating the URL, getting the data and push it to Amazon DynamoDB - but I would love a sort of existing service, which made me not worrying about server OS, cronjobs etc...

Any help to such service, perhaps directly via AWS?

解决方案

AWS Lambda now supports Scheduled Tasks. Since Lambda can make HTTP requests and write to DynamoDB, using Lambda should work and you don't have to worry about setting up an EC2 instance with a cron job just for that.

这篇关于每X秒自动通过URL检索JSON数据,并存储在Amazon DynamoDB中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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