今天的版本答案
Serverless Computing: 我才不管并发呢
- Function as a Service (FaaS): 系统自动 scale 到 C10M
const AWS = require('aws-sdk');
const dynamo = new AWS.DynamoDB.DocumentClient();
exports.handler = async (event) => {
const body = JSON.parse(event.body);
const { username, password } = body;
await dynamo.put({
TableName: 'Users',
Item: { username, password, }
}).promise();
return { statusCode: 201, body: JSON.stringify(...), };
};