Serverless application architecture

Serverless models are designed to be very efficient and cost-effective. They provide a high level of abstraction over the computing layer and they are 100% designed to be stateless.

The stateless design principle consists of offloading all persistence out of the compute service, in the following diagram several persistence services are used, such as Amazon S3, Amazon ElasticSearch, and DynamoDB.

This architecture represents a voting platform with a real-time dashboard that presents voting results in real time. Every vote is done via a mobile app. When the user votes, this event triggers an API gateway service endpoint invoking a custom resource like POST /votes/candidate.

When this vote is received by the API gateway resource an integration is executed, for this case is a Lambda function that provides the logic to increment the valid_votes table for the specific candidate.

DynamoDB can be enabled to publish modifications to DynamoDB Streams, this streams can be processed with every new event by a second Lambda function that will increment a fragment of the static web page shown hosted on an S3 bucket.

Here every request is performed to Route 53 (1), public hosted zones respond with different answers like ElasticSearch (3); this service can be used to index documents from DynamoDB (6) streams acting as a search domain for applications. Mobile apps can interact with this search cluster to achieve fast retrieval of data. All static information like media or images are stored directly on the S3 bucket for the application and dynamic backend logic is handled by the API Gateway (5) service. This API Gateway is integrating requests with AWS Lambda functions that are limited on execution time and do not provide local storage; here the DynamoDB (6) service is used to store key-value pairs and JSON documents and it is an excellent data store for temporary data needs as shopping carts or application data.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.171.253