/functions folder and they'll be deployed and runnable!
Oh no! Not more jargon! What exactly does the term Durable Functions mean? Durable functions have to do with Serverless architectures. It’s an extension of Azure Functions that allow you to write stateful executions in a serverless environment.
Think of it this way. There are a few big benefits that people tend to focus on when they talk about Serverless Functions:
- They’re cheap
- They scale with your needs (not necessarily, but that’s the default for many services)
- They allow you to write event-driven code
You clever dog. You've rooted it out! It turns out when you build things with serverless technology you're still using servers. Pardon the patronizing tone there, I've seen one-too-many hot takes at this point where someone points this fact out and trots away triumphantly.
And yes, because serverless still involves servers, the term might be a bit disingenuous to some. You could be forgiven for thinking that serverless meant technologies like web workers, which use the client to do things you might have otherwise done on a server and is where the term serverless was headed. Alas, it is not.
If you don’t already know of it, Todd Motto has this great list of public APIs. It’s awesome if you’re trying out a new framework or new layout pattern and want to hit the ground running without fussing with the content.
But what if you want or need to make your own API? Serverless can help create a nice one for data you’d like to expose for use.
Serverless really shines for this use case, and hopefully this post makes it clear why. In a non-serverless paradigm, we have to pick something like express, we have to set up endpoints, we have to give your web server secured access to your database server, you have to deploy it, etc. In contrast, here we'll be able to create an API in a few button clicks, with minor modifications.
David Wells, from Netlify, and I take some baby steps into building things with Serverless. We'll mostly be looking at cloud functions here and how using them from an otherwise static hosting environment means you've unlocked all sorts of possibilities.
Links from the video:
- Netlify's support of cloud functions
- The Power of Serverless for Front-End Developers
- The TODO list example, using netlify-faunadb-example. "This application is using React for the frontend, Netlify Functions for API calls, and FaunaDB as the backing database."
David Wells, from Netlify, and I take a crack at answering this question in an understandable way.
Are there still servers involved? Of course, but you don't manage them, scale them, or pay for them when you aren't using them. It really is a different model that deserves a new name.
Better yet, they enable front-end developers like us to do more than we ever thought we could. We'll cover a variety of use cases that might get you thinking.
The internet is, without metaphor, just a bunch of servers tied together with wires. Without servers, we'd have no way to share our creations with the world. Yet, in a bit of a paradox, servers are less essential to our work than they've ever been. We can now do things on the front-end that used to require a back end. When we do need a backend, our front-end skills can be put to work, giving us some surprisingly powerful new abilities.
The site that goes along with this talk is: The Power of Serverless for Front-End Developers (thepowerofserverless.info).
Thanks to An Event Apart for sponsoring this! I originally created and gave this talk at An Event Apart in early 2018. It was part of a larger whole because the editorial team at AEA works closely with the speakers. At AEA, you’ll find that each presentation sheds light on the next—that the event is not merely a collection of disparate talks, but a curated, cutting-edge curriculum for the modern designer, coder, and strategist. A curriculum that continues after the conference ends, with slides, articles, videos and other resources shared freely on our website.
At An Event Apart, you won’t just learn what’s happening right now. You’ll also look ahead to what’s next.
Abstracting infrastructure is in our DNA. Roads, schools, water supply networks—you get the idea. Web development is no exception: serverless architectures are a beautiful expression of that phenomenon. Static sites, in particular, are turning into dynamic, rich experiences.
Handling static forms, authentication, and backend functions on statically-generated sites is now a thing. Especially with the JAMstack pioneer platform that is Netlify. Recently, they announced support of AWS Lambda functions on front-end-centric sites and apps. I've been meaning to dive into their "backend" features since.
Today, I'm doing just that, using a static Gatsby site, Netlify's Forms, Identity, and Functions features. This tutorial will show you how to:
- Add static forms to your site
- Add user authentication for password-protected content
- Create an AWS Lambda function
Ready to supercharge a static site with serverless features?
- Local Debugging with VS Code
- Installing npm packages
- Configuring REST-like URLs
- Saving environment variables
All in all, it's one of the best talks on Serverless I've seen, and if you're interested in this topic, then I highly suggest giving it a watch.
I like to jog. Sometimes it’s cold out. Sometimes it’s cold out, but it looks like it isn’t. The sun is shining, the birds are chirping. Then you step outside in shorts and a t-shirt and realize you have roughly 2 minutes before exposure sets in.
I decided to solve this first world problem using a lightbulb to display a certain color based on what the temperature outside is. It works better than I expected, and that’s saying something because usually nothing works out like I want it to.