I’m making a mobile app that relies on RSS feeds for some of its content, but instead of hitting the feed directly, I want to be able to hit an API for content where I can do things like query, sort, etc
At a high level, this is what I’m thinking: I would need to have a task run every X minutes that hits the feed, and writes the diff since the last read into a db. Then I would need to set up an API the app can hit that will read from the db and probably format the response a bit. I’m thinking I could probably use API gateway + Lambda for this part? What services would I use for the scheduled parser and DB writes?
I’m not sure how to best accomplish this, or even really how to start, and am looking for advice.
Could use CloudWatch to invoke a lambda job. But the addition of the CloudWatch feature, and limitations to only having like 25 or 50 per AWS account, is asinine.
I have a need for something similar and I think I’m just going to use a EC2 running some dumb ass cron shit.
Short scheduled tasks are perfect for Lambda. You can schedule them using CloudWatch Events. Check out https://github.com/LeafSoftware/python-lambder. We use it for all kinds of cron-style jobs.
I am not even sure why people are complicating this, make an API, deploy it to a couple of micro/small instances, put API gateway in front and bob’s your uncle.
Yes, what WarInternal said. This is a service limit, like the others. If you have a use case, just submit a limit increase ticket and they’ll fix it up for you. They limit things initially to help manage capacity planning, and a healthy dose of checks and balances against people compromising AWS and running too far amok.
Agree with everything /u/diecastbeatdown and /u/aalbertson said - /u/Guerilla_Imp you’re coming across here as very un-knowledgeable. Wh would you ‘make an API’ ‘deploy it to some instances’ and then ‘use API gateway’ it strikes me that you aren’t across how ANY of those services actually operate.
/u/purpledogman would be much better off using API gateway for its intended purpouse and have this fronting other AWS services such as lambda to provide serverless compute as required. That way, the costs are truly pay as you use, you can scale as required and you dont have the admin or cost overhead of managing servers.
How would you tackle the problem of knowing what the last item you processed was in the feed? Becsuse I only want to ingest the delta, otherwise I’d be making many redundant DB writes. Is there a way I can maybe pass back the last item id through context.done and then pass it back into the lambda function on execute? Like how/where can I store that variable, since lambda is stateless?
Not really sure why you’d store a diff - why not just grab the n most recent posts from the feed - iterate over them, if each record isn’t in your DB yet, write it. Once you hit a record that is in your DB already, then you can stop.