Why Cloud Computing?
A cloud-based server utilizes virtual technology to host a company’s applications offsite. There are no capital expenses, data can be backed up regularly, and companies only have to pay for the resources they use. For those organizations that plan aggressive expansion on a global basis, the cloud has even greater appeal because it allows you to connect with customers, partners, and other businesses anywhere with minimal effort.
Additionally, cloud computing features nearly instant provisioning because everything is already configured. Thus, any new software that is integrated into your environment is ready to use immediately once a company has subscribed. With instant provisioning, any time spent on installation and configuration is eliminated and users are able to access the application right away.
Important Benefits of Cloud Computing
- On-Demand Self-service
- Multi-tenancy
- Offers Resilient Computing
- Fast and effective virtualization
- Provide you low-cost software
- Offers advanced online security
- Location and Device Independence
- Always available, and scales automatically to adjust to the increase in demand
- Allows pay-per-use
- Web-based control & interfaces
- API Access available.
AWS Lambda
AWS Lambda is a serverless compute service that runs your code in response to events and automatically manages the underlying compute resources for you. You can use AWS Lambda to extend other AWS services with custom logic, or create your own back-end services that operate at AWS scale, performance, and security. AWS Lambda can automatically run code in response to multiple events, such as HTTP requests via Amazon API Gateway, modifications to objects in Amazon S3 buckets, table updates in Amazon DynamoDB, and state transitions in AWS Step Functions.
// Handler value: example.HandlerDynamoDB
public class HandlerDynamoDB implements RequestHandler{
private static final Logger logger = LoggerFactory.getLogger(HandlerDynamoDB.class);
Gson gson = new GsonBuilder().setPrettyPrinting().create();
@Override<
public String handleRequest(DynamodbEvent event, Context context)
{
String response = new String("200 OK");
for (DynamodbStreamRecord record : event.getRecords()){
logger.info(record.getEventID());
logger.info(record.getEventName());
logger.info(record.getDynamodb().toString());
}
logger.info("Successfully processed " + event.getRecords().size() + " records.");
// log execution details
Util.logEnvironment(event, context, gson);
return response;
}