Series 2 – Why Lambda is useful for mobile applications ?
User access via mobile applications is becoming increasingly popular as consumer access to business applications, products and services is the new normal. As a business ensuring a good consumer experience via mobile application is critical to getting the consumer to spend. This means your back-end infrastructure must scale seamlessly and ensure transactions in a secure manner.
Imagine a scenario where you have launched a promotional campaign and your infrastructure crashes, or your website suffers an attack. The damage it causes to the brand is a long term business impact, making recovery hugely challenging.
With AWS Lambda, deploying and managing mobile apps become easy as many of the functions are pre-built and automated. Deploying a server less mobile application means you do not have to worry about configuring the underlying servers you use for the application.
Lambda lets you run code for virtually any type of application or backend service – all with zero administration. You can run code without provisioning or managing servers and only for the compute time you consume – there is no charge when your code is not running. Just upload your code and Lambda takes care of everything required to run and scale your code with high availability. You can set up your code to automatically trigger from other AWS services or call it directly from any web or mobile app.
Further you can use AWS Cognito along with Lambda to manage user identities, authentication, and permissions as the mobile application must have valid security credentials and permissions to invoke a Lambda function through API Gateway. Amazon Cognito lets you easily add user sign-up and sign-in to your mobile and web apps.
AWS Cognito enables you to implement enhanced security features, such as email and phone number verification, and multi-factor authentication. Cognito Identity also lets you customize workflows through AWS Lambda such as adding app-specific logic to user registration for fraud detection and user validation.
You can achieve this by invoking AWS Lambda functions over HTTPS, defining a custom REST API and endpoint using Amazon API Gateway and mapping individual methods to specific Lambda functions. When you send an HTTPS request to the API endpoint, the Amazon API Gateway service invokes the corresponding Lambda function. Amazon API Gateway also adds a layer between your application users and app logic that enables the following:
- Ability to throttle individual users or requests.
- Protect against Distributed Denial of Service attacks.
- Provide a caching layer to cache response from your Lambda function.
Another AWS Lambda feature which allows scaling and inherent robustness is that it supports micro services architecture. Individual components to be deployed and scaled independently without impacting other micro services.
AWS Lambda is a quick and cost-effective way to deploy mobile application as billing is based on usage, allowing you to scale without re-architecting the application. You don’t need to provision server hardware for peak load, instead you can focus on core business and better customer experience. This frees you to focus on creating great app experiences instead of worrying about building, securing, and scaling a solution to handle user management, authentication, and synching across devices.