今天登陆 amazon AWS console发现AWS Lambda在图片上传、应用内活动、点击网站或联网设备的输出等事件发生后的几毫秒内开始运行代码。开发者还可以利用AWS Lambda开发新的后台服务,让计算资源根据自定义请求自动触发。
开发者只需为获得服务的请求数以及运行代码所需的计算时间付费。AWS Lambda按计算时间收费,计费单位为100毫秒,因此可以经济、轻松地把应用从每天几次请求扩展到所需要的任何规模的请求。
AWS Lambda支持包括本地库在内的任何第三方库,因而开发者无需学习任何新的编程语言、工具或框架。开发者可以直接在AWS Lambda中编辑功能,这意味着他们无需编译编辑的内容、变更构建然后重新部署,即可即时更新应用。通过AWS Lambda,开发者可以创建自己的后台并以AWS的规模、性能和安全性运行。AWS Lambda可在事件发生后的几毫秒内运行代码。由于每个事件是被作为单个功能进行处理的,因此在事件频率增加时仍可保持一致的高性能。
目前只有US-EAST,US-WEST,EU三个region开通:
下面摘自官网http://aws.amazon.com/cn/lambda/faqs/上关于AWS lambda 的问答:
General
Q: What is AWS Lambda?
AWS Lambda is a compute service that runs your code in response to events and automatically manages the compute resources for you, making it easy to build applications that respond quickly to new information. AWS Lambda starts running your code within milliseconds of an event such as an image upload, in-app activity, website click, or output from a connected device. You can also use AWS Lambda to create new back-end services where compute resources are automatically triggered based on custom requests. With AWS Lambda you pay only for the requests served and the compute time required to run your code. Billing is metered in increments of 100 milliseconds, making it cost-effective and easy to scale automatically from a few requests per day to thousands per second.
Lambda runs your code on high-availability compute infrastructure and performs all the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code and security patch deployment, and code monitoring and logging. All you need to do is supply the code.
Q: What events can trigger an AWS Lambda function?
You can use AWS Lambda to respond to table updates in Amazon DynamoDB, modifications to objects in Amazon S3 buckets, messages arriving in an Amazon Kinesis stream, AWS API call logs created by AWS CloudTrail, and custom events from mobile applications, web applications, or other web services. Here are some sample use cases for AWS Lambda.
Q: When should I use AWS Lambda versus Amazon EC2?
Amazon Web Services offers a set of compute services to meet a range of needs.
Amazon EC2 offers flexibility, with a wide range of instance types and the option to customize the operating system, network and security settings, and the entire software stack, allowing you to easily move existing applications to the cloud. With Amazon EC2 you are responsible for provisioning capacity, monitoring fleet health and performance, and designing for fault tolerance and scalability. AWS Elastic Beanstalk offers an easy-to-use service for deploying and scaling web applications in which you retain ownership and full control over the underlying EC2 instances.
AWS Lambda makes it easy to execute code in response to events, such as changes to Amazon S3 buckets, updates to an Amazon DynamoDB table, or custom events generated by your applications. With Lambda you do not have to provision your own instances; Lambda performs all the operational and administrative activities on your behalf, including capacity provisioning, monitoring fleet health, applying security patches to the underlying compute resources, deploying your code, running a web service front end, and monitoring and logging your code. AWS Lambda provides easy scaling and high availability to your code without additional effort on your part.
Q: What kind of code can run on AWS Lambda?
AWS Lambda offers an easy way to run code in the cloud, from simple activities like compressing files arriving in Amazon S3 to more complex tasks, such as performing facial recognition on uploaded images.
Q: What languages does AWS Lambda support?
At launch AWS Lambda supports code written in Node.js (JavaScript). Your code can include existing Node.js libraries, even native ones.
Q: Can I access the infrastructure that AWS Lambda runs on?
No. AWS Lambda operates the compute infrastructure on your behalf, allowing it to perform health checks, apply security patches, and do other routine maintenance.
Q: What is Lambda’s service availability?
AWS Lambda is designed to provide 99.99% availability for both the service itself and for the functions it operates. There are no maintenance windows or scheduled downtimes.
Q: How does Lambda isolate my code?
Each AWS Lambda function runs in its own isolated environment, with its own resources and file system view. AWS Lambda uses the same techniques as Amazon EC2 to provide security and separation at the infrastructure and execution levels.