亚马逊云科技最近推出了 Lambda Web Functions,让开发者能够直接在 Lambda 上运行使用 Express 和 Hono 等框架构建的 Node.js Web 应用,并支持并发请求和流式响应。
根据 Lambda Web Functions 文档,新函数支持并发 HTTP 请求和流式响应。其计费依据是活跃 CPU 时间和内存,而不是等待下游服务期间的 CPU 时间。多区域路由会将请求发送到距离最近的区域,而一个已经预热的执行环境可以同时处理多个并发请求,从而显著减少冷启动。现有 Lambda 函数现在被称为 Lambda Event Functions,无须进行任何改动。亚马逊云科技高级解决方案架构师 Micah Walter 总结了它的优势,以及它为何能够消除这些复杂性:
你可以使用 Express、Hono、Fastify、Next.js 或任何 Node.js 框架构建一个监听标准端口的服务器,通过一条命令进行部署,随后 Lambda 会自动处理扩缩容、多区域分发和活跃 CPU 计费。无须适配器,无须管理基础设施,也不会被框架锁定。
端点默认使用 Lambda 提供的域名。如果需要使用自定义域名、边缘缓存或 AWS WAF,开发者可以在前端部署 Amazon CloudFront,并将 Lambda Web Functions 作为源站。
Lambda Web Functions 面向 HTTP 工作负载,包括全栈 Web 应用、REST 和 GraphQL API,以及可以独立扩展的微服务。它还支持服务器端渲染和流式响应,例如大语言模型的增量输出,而无须单独的托管层。
Lambda Web Functions 目前仅支持 Node.js;包括 Python、Java 和 .NET 在内的其他语言仍可通过传统 Lambda 函数使用。今年早些时候,亚马逊云科技还推出了 Lambda MicroVM,为运行不可信代码或用户生成代码提供隔离的有状态沙箱环境,并允许客户自行管理生命周期。
在《探索如何使用 AWS Lambda Web Functions 构建 Web 应用》一文中,Julian Wood、Kim Wendt 和 Samrat Karak 构建了一个示例应用,展示单个执行环境如何同时处理多个请求,以及应用程序如何服务全球用户。他们总结道:
Lambda Web Functions 无须适配层,即可将无服务器运维模型带入 Web 应用。你只需编写一个标准 Node.js HTTP 服务器,通过一条命令或 CloudFormation 进行部署,就能获得一个可扩展、按使用量计费的 HTTPS 端点,并内置全球路由。
Reddit 和 Hacker News 上的社区反响总体积极,讨论重点包括更简单的编程模型和并发请求支持。不过,讨论也提出了有关 Python 支持,以及该服务与现有替代方案有何区别的问题。用户 magnetik79 评论:
这是一次重大更新——也很高兴看到一个不完全围绕 AI 打磨的功能。☺️ 看起来很棒的地方在于:许多工作负载现在可以完全绕过 API Gateway(……)这彻底改变了目前 Lambda 的 HTTP 编程模型——现在不再是一次调用对应一个请求,你可能需要开始关注同步和互斥锁问题。
亚马逊云科技首席开发者布道师 Eric Johnson 在《为什么我对 AWS Lambda Web Functions 感到兴奋》一文中强调,Lambda Web Functions 无须修改即可运行标准 HTTP 服务器和框架,并通过一个托管端点支持 REST、服务器发送事件、流式响应、RPC、Webhook 和 IAM 身份验证。
亚马逊云科技并不是唯一提供这种模式的云服务商:Google Cloud Run 和 Azure Container Apps 也支持无须适配层的 Web 应用、缩容至零和可配置并发,因此适合具有间歇性或突发流量的工作负载。
Lambda Web Functions 的定价基于活跃 CPU 时间和内存使用量,对于需要花费较多时间等待数据库或 API 的工作负载,可能有助于降低成本。内存则按照执行环境的整个生命周期计费。这种模式可能适合服务器端渲染、API 后端和流式 AI 推理等 I/O 密集型工作负载。该服务目前已在五个区域推出:北弗吉尼亚、俄亥俄、俄勒冈、东京和爱尔兰。
原文链接:
https://www.infoq.com/news/2026/10/aws-lambda-web-functions/
本文由 AI宝库自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
Amazon Cloud Technologies recently launched Lambda WebFunctions, which allows developers to run the Node.js Web application directly on Lambda using frames such as Express and Hono, and to support requests and current responses.
According to Lambda WebFunctions documents, the new function supports simultaneous HTTP requests and current responses. The charge is based on active CPU time and memory, rather than on waiting for downstream CPU time. Multi-regional routers send requests to the nearest region, while a pre-heated implementation environment allows multiple simultaneous requests to be processed, thereby significantly reducing cold start-ups. The current Lambda function is now known as Lambda Event Fundings, without any change. Micah Walter, the architect of advanced solutions for Amazon cloud technology, summarized its strengths and how it could eliminate these complexities:
You can use Express, Hono, Fasty, Next.js or any Node.js framework to build a server that listens to a standard port, deploys by an order, and then Lambda will automatically process the amplification, multi-area distribution and active CPU charges. No adaptor, no infrastructure management, and no frame lock.
End defaults on the domain name provided by Lambda. If a custom domain name, edge cache or AWS WAF is required, the developer can deploy Amazon CloudFront at the front end and use Lambda WebFunctions as a source station.
Lambda WebFunctions for HTTP task loads, including full house Web applications, REST and GraphQL API, as well as stand-alone microservices. It also supports server rendering and current responses, such as the incremental output of large language models, without a separate hosting layer.
Lambda WebFunctions currently only supports Node.js; other languages, including Python, Java and.NET, can still be used through the traditional Lambda function. Earlier this year, Amazon cloud technology also launched Lambda MicroVM, which provides a state-of-the-art sandbox environment for running untrustworthy codes or user-generated codes and allows clients to manage their own life cycle.
In exploring how to use AWS Lambda WebFunctions to construct Web applications, Julian Wood, Kim Wendt and Samrat Karak built an example application to show how a single implementation environment handles multiple requests at the same time and how the application serves global users. They concluded:
Lambda WebFunctions does not need to fit a layer to bring a server-free mode into the Web application. All you have to do is create a standard Node.js HTTP server, deployed by a command or ClaudFormation, which will provide an extended, user-based HTTPS endpoint and a global route.
Community reactions on Reddit and Hacker News were generally positive, with discussions focusing on simpler programming models and requests for support. However, the discussion also raised questions about Python support and how the service differed from existing alternatives. Other Organiser
It's a major update -- and it's nice to see a function that's not exactly around AI. It seems great that many of the loads are now completely bypassed by API Gateway(s) which completely changes the current HTTP programming model of Lambda – now it is no longer a call to respond to a request, and you may need to start focusing on the issues of synchronization and mutually exclusive locks.
Eric Johnson, Chief Developer of Amazon Cloud Technologies, in " Why am I Excited About AWS Lambda WebFunctions ", stressed that Lambda WebFunctions can run standard HTTP servers and frames without modifications and support RST, server sending events, current responses, RPC, Webbrook and IAM identification through a hosting end point.
Amazon cloud technology is not the only cloud service provider that provides this model: Google Cloud Run and Azure Container Apps also support Web applications that do not need a layer, indents to zero and can be configured and distributed, and therefore suitable for work loads with intermittent or sudden flows.
The pricing of Lambda WebFunctions is based on active CPU time and memory usage, which may help reduce costs for work loads that take more time to wait for databases or API. Memory is costed over the life cycle of the implementing environment. This pattern may be suitable for I/O intensive loads such as server rendering, API backend and flow-based AI reasoning. The service is now available in five regions: North Virginia, Ohio, Oregon, Tokyo and Ireland.
Original link:
https://www.infoq.com/news/2026/10/aws-lambda-web-functions/
Auto-fetched and translated by AI Gem Box. All rights belong to the original author.