擅长:python、mysql、java
<p>对于像我这样查过这个的人,AWS现在提供<a href="http://docs.aws.amazon.com/lambda/latest/dg/welcome.html">Lambda</a></p>
<blockquote>
<p>AWS Lambda is a compute service that makes it easy for you to build
applications that respond quickly to new information. AWS Lambda runs
your code in response to events such as image uploads, in-app
activity, website clicks, or outputs from connected devices. You can
use AWS Lambda to extend other AWS services with custom logic, or
create your own back-end that operates at AWS scale, performance, and
security. With AWS Lambda, you can easily create discrete,
event-driven applications that execute only when needed and scale
automatically from a few requests per day to thousands per second.</p>
</blockquote>
<p>这里有一个很好的演练,它完美地回答了这个问题,<a href="http://docs.aws.amazon.com/lambda/latest/dg/walkthrough-s3-events-adminuser.html">Handling Amazon S3 Events</a>。我们的想法是让node.js包(Labmda)得到有关S3 Bucket事件(在我们的例子中创建的对象)的通知,获取上传的对象,调整其大小,最后将其保存到另一个Bucket中作为缩略图。由于您将拥有node.js应用程序,因此在保存缩略图之后,您基本上可以对任何需要的服务发出任何类型的请求。</p>