惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
WordPress大学
WordPress大学
小众软件
小众软件
Cloudbric
Cloudbric
AWS News Blog
AWS News Blog
腾讯CDC
量子位
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Vulnerabilities – Threatpost
Scott Helme
Scott Helme
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
IT之家
IT之家
Jina AI
Jina AI
Attack and Defense Labs
Attack and Defense Labs
S
SegmentFault 最新的问题
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
Google Online Security Blog
Google Online Security Blog
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
罗磊的独立博客
L
LINUX DO - 最新话题
博客园 - Franky
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
The Last Watchdog
The Last Watchdog
J
Java Code Geeks
AI
AI
C
Cisco Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
Help Net Security
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
I
Intezer
S
Securelist

ByteofDev

Making Postgres 42,000x slower because I am unemployed A Quick(ish) Introduction to Tuning Postgres JavaScript numbers have an (adoption) problem My 2025 JavaScript Wishlist JavaScript Benchmarking Is a Mess Replacing Disqus Commenting A deep dive into distributed database architectures 10 ways to speed up web image loading Tailwind has a scalability problem. How can we solve that? Lerna vs Turborepo vs Rush: Which is better in 2023? The 6 JavaScript Projects to watch in 2023 Top 5 Alternatives to React in 2023 How to use ESM on the web and in Node.js React vs Svelte: Which is better in 2023? 10 ways to speed up JavaScript loading What is Bun, and does it live up to the hype? State of JS 2021 Results and Analysis State of the Web: React 10 ways to speed up web font loading State of the Web: Atomic CSS State of the Web: Static Site Generators State of the Web: Bundlers & Build Tools Migrating ByteofDev from SvelteKit to Astro State of the Web: Deno Array.map() versus Array.forEach() A quick introduction to JavaScript Maps How I Built the Fastest JavaScript Data Differ State of the Web: WebAssembly When you should and shouldn't use React
State of the Web: Serverless Functions
Jacob Jackson · 2022-01-16 · via ByteofDev

Serverless functions (also known as Function as a Service) execute code statelessly on the Cloud. This means that they can do things like scale infinitely and run anywhere. There are many different serverless function providers, like AWS Lambda, Cloudflare Workers, and Vercel.

Background of Serverless Functions

Google created the first serverless model in their Google App Engine product, which offered auto-scaling stateless code execution. App Engine was different from most more recent serverless function providers, but it was the first product to try this idea. However, while it was used by companies like Snapchat, it did not catch on with the overall developer community.

The first Function as a Service (FaaS) provider to truly catch on was AWS Lambda. AWS Lambda was a serverless function service that Amazon released in November 2014. Lambda allows for functions written in many different languages to automatically scale in under a second while allowing users not to have to worry about the underlying hardware. Companies like Google, Microsoft, and Oracle also created their own service for serverless functions. Although to this day, Lambda is the most popular serverless function provider, and since its release, it has become faster, more flexible, and easier to use.

However, that is not the end of the story. Since then, many services have improved on AWS Lambda’s model in ways like ease of use and performance. The first notable FaaS provider was Vercel (ZEIT Now at the time), which was released in April of 2016 and was a lot simpler to use than Lambda. Another selling point was that it integrated well with Next.js, a React framework made by Vercel. Other, newer services also try to be a lot easier, like Begin, although Vercel is still the most popular in that group.

The second major innovation in serverless functions was edge computing with lightweight isolates. This was pioneered by Cloudflare Workers, a serverless product released in September 2017. It promised to allow your code to run on any of the many Points of Presence Cloudflare has worldwide, and it used V8 Isolates to reduce the startup time to a few milliseconds, and later, even zero.

Why Serverless Functions are Significant

Performance

Many serverless function providers offer high-speed services. As talked about in the background, edge computing has revolutionized serverless functions. Because serverless functions are stateless, they do not need to always run in the same place. This means they can work like CDNs and automatically deliver content from data centers close to users (the “edge”) rather than one centralized location. Serving from the edge can be a huge difference in latency for large networks like Cloudflare’s. Not all serverless function providers support this, but a growing number do, like Netlify, Cloudflare Workers, Vercel, AWS Lambda@Edge, and more.

Scalability

Unlike virtual machines, serverless functions can usually scale from zero to infinity. This means that you never get overloaded by requests, and you don’t have to waste money on computing power that you are not using. Whenever users request the HTTP endpoint, most serverless function providers automatically determine whether there are already running functions that can process the request. If there are not, a new function is created. Additionally, if function instances are not processing anything, they are automatically stopped. Some virtual machine and container services also offer autoscaling, but because it takes longer to start a virtual machine/container, it is much less granular.

Ease of Setup

Serverless functions abstract over the hardware usually (hence the serverless). Instead of worrying about setting up servers and operating systems, the provider takes care of everything. This is not necessarily unique to serverless functions, as containers and virtual machines usually do this too, but with serverless functions, you don’t even need to worry about the operating system or software running your code. The advantage of not managing your hardware and operating system is that you can get started a lot faster and not have to worry about as much.

The State of Serverless Functions

Language support

You can use almost any language with serverless functions. Whether you are using JavaScript, Go, or C, most serverless function providers support them. However, if you use a V8-based serverless function setup (most edge serverless function setups do this), language support might be more limited. Since V8 is primarily a JavaScript engine, the best-supported language is JavaScript. However, sometimes you want to use languages that do not support compiling to JavaScript. The solution is often WebAssembly, a portable assembly-like language that most modern languages support as a compilation target. WebAssembly also has other advantages, like how it can often perform faster. For more information on WebAssembly, you can look at our article on WebAssembly.

Production readiness

Serverless functions are used by many different companies and are supported by some of the biggest names in web hosting like AWS and Cloudflare. While serverless functions are somewhat new, they are still very production-ready.

Running on the Edge

Edge serverless functions are still experimental for the most part. However, some services are battle-tested, namely AWS Lambda@Edge and Cloudflare Workers. These services have existed for multiple years and are used by companies like NPM and Amazon. There are also other more recent services offered by companies like Vercel, Netlify, and Fastly.

Conclusion

That is it! Hopefully, now you understand serverless functions, why they are helpful, and what state they are currently in. If you liked this article, be sure to sign up for the mailing list below. I hope you learned something, and thanks for reading.