from Hacker News

Ask HN: Need a simple HTTP service that allows basic string persistence

by roberja90 on 6/6/21, 4:18 PM with 4 comments

I am building a simple bot. The bot scrapes an RSS feed. The only persistence I need is the date time of the most recent item on the RSS feed. I dont want to have to spin up a DB.

What would be great is a service that allows something like the following simple-storge.com/account-id?data=the-date-i-want-to-store

Anyone know of anything like this that exists?

Any help greatly appreciated.

  • by vhodges on 6/6/21, 4:28 PM

    How durable do you need it to be?

    A small go service writing to a sqlite db would be pretty easy (and probably pretty performant) but needs streaming replication to improve robustness/durability. For that see:

    https://litestream.io/ and https://mtlynch.io/litestream/ (an example) Edit: I just re-read the mylynch.io post and it probably has all the code you need.

    Probably could run it on the fly.io free tier + S3/B2 storage costs.

  • by pwg on 6/6/21, 4:44 PM

    > I am building a simple bot. The bot scrapes an RSS feed. The only persistence I need is the date time of the most recent item on the RSS feed. I dont want to have to spin up a DB.

    So, open a local file, overwriting any old contents, and write out the date and time of the most recent item retrieved when done.

    Then, before starting the next fetch, open the file and read in the saved date/time to use to determine which new items to fetch.