Live data from Hacker News

Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

serverless.com

21–30 of 48 posts

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#21
post #18

Instead of hourly polling, which I find quite inelegant, couldn't you trigger creation of new schedule rule with the correct time that then triggers the publishing?

Hey zokier. Thanks for the comment.

In theory yes. I could provision a new function with an exact cron schedule to run once and then tear itself down.

In practice, this is a lot of extra logic to write to achieve this and would also potentially make own AWS account rather messy.

The hourly cron runs about 720 times a month which is far below the 1,000,000 free invocations that lambda provides under their free tier.

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#22

Earlier quoted context omitted.

AWS lambda functions __are__ serverless. There's no notion of uptime, provisioning or managing servers when using lambda.

This is true, but what triggers the lambda function to run? Where does the lambda function run when its triggered?

"Serverless" really means "your code is run as a container with a finite lifetime on an arbitrary machine in a standardized, non-configurable PaaS machine cluster."

In essence, it's a return to the "cgi-bin" model of scripting, where you write a script that only runs for the lifetime of one request, and then a web server will spin it up to respond to a relevant request and it'll terminate at the end of that request.

The only differences in the modern instantiation of the concept, are that:

1. the "cgi-bin" directory is a mounted object store, common to an entire cluster; and

2. there's some fancy preloading logic that lets Lambda functions stay "hot" between calls to them, so that they can run very quickly. (Sort of like Phusion Passenger does for Ruby code, except with enough isolation to make it safe for multitenant environments. Heroku's old Alpine stack might be a better comparison.)

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#23

AWS lambda and 'serverless' to replace a cronjob And paying Amazon for the privilege of doing so! Well done... golf clap

Thanks tom! I love golf!

> The hourly cron runs about 720 times a month which is far below the 1,000,000 free invocations that lambda provides under their free tier.

This entire service (the 2 functions & 1 dynamo table) should run well under the AWS free tier. see https://aws.amazon.com/free/

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#24

AWS lambda and 'serverless' to replace a cronjob And paying Amazon for the privilege of doing so! Well done... golf clap

Thanks tom! I love golf! > The hourly cron runs about 720 times a month which is far below the 1,000,000 free invocations that lambda provides under their free tier. This entire service (the 2 functions & 1 dynamo table) should run well under the AWS free tier. see https://aws.amazon.com/free/

Does this not seem excessive? Doesn't anyone care about simplicity, or elegance, or -- at minimum -- not relying on others?

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#25

Since serverless uses AWS primarily. I'm assuming if I put all my eggs in the serverless basket and Amazon has some amazing outage. I'm screwed? To which I don't understand the appeal of serverless besides having no servers lol.

And it's still a static web site, so you're only "screwed" in terms of updates. And if you can't wait for Lambda to be restored, either run the script locally or manually hot-fix those static HTML files.

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#27
post #11

Earlier quoted context omitted.

I use jekyll NOT because it's simple (Actually it's 100 times more complex to use than a simple wordpress or medium) but because: 1. I can keep track changes with git 2. I can host them on Github pages for FREE 3. I own the content 4. More flexible In fact I've been really annoyed with all the boilerplate code and extensions I need to deal with in order to have a "usable" workflow set up, I almost thought about movin…

Jekyll is way more simple from a "stack" perspective. It has no database, has less moving parts. Wordpress is simple from an end user perspective. Services like medium and tumblr hide the complexity from its users. Its a trade off.

What you said is all correct.

But my point was it's not just about "simplifying the stack". You said "the allure of a static site or a static blog is to simplify the stack;", but the thing is, not everyone thinks that way.

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#28

Earlier quoted context omitted.

Thanks tom! I love golf! > The hourly cron runs about 720 times a month which is far below the 1,000,000 free invocations that lambda provides under their free tier. This entire service (the 2 functions & 1 dynamo table) should run well under the AWS free tier. see https://aws.amazon.com/free/

Does this not seem excessive? Doesn't anyone care about simplicity, or elegance, or -- at minimum -- not relying on others?

Good point. I care greatly about these things.

This project greatly simplifies how we publish content in an elegant out of sight out of mind way.

Before, if someone was out of town, we would need to rely on others to push the merge button on posts for us. Now, the robots do it for us!

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#29
post #8

This solution is sort of weird to me. To me, the allure of a static site or a static blog is to simplify the stack; To bring it back to the basics. Static HTML served by a good ole-fashion web server. Adding the cognitive burden of "serverless" and/or lambda just to schedule seems to complicate something that isn't very complicated. Its almost like an invented problem. That said, long live this static site generator…

I use jekyll NOT because it's simple (Actually it's 100 times more complex to use than a simple wordpress or medium) but because: 1. I can keep track changes with git 2. I can host them on Github pages for FREE 3. I own the content 4. More flexible In fact I've been really annoyed with all the boilerplate code and extensions I need to deal with in order to have a "usable" workflow set up, I almost thought about movin…

Simple != easy.

Wordpress and co are easy, but they're fundamentally much more complex than static sites.

Jekyll is quite simple, but it can be hard to use in comparison.

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#30

Earlier quoted context omitted.

Thanks tom! I love golf! > The hourly cron runs about 720 times a month which is far below the 1,000,000 free invocations that lambda provides under their free tier. This entire service (the 2 functions & 1 dynamo table) should run well under the AWS free tier. see https://aws.amazon.com/free/

Does this not seem excessive? Doesn't anyone care about simplicity, or elegance, or -- at minimum -- not relying on others?

>not relying on others

Avoiding AWS based solutions to "not rely on others" is like using a kerosene lamp in the center of Manhattan. You may be more self sufficient, but.... why?

Post reply on HN