AWS Thinking Serverless
How to Think Serverless
To think serverless is to think asynchronous.
Thinking asynchronous is to write asynchronous code.
Asynchronous code does not need to wait for the execution of other code blocks.
Asynchronous code is code that runs at the same time as other code.
The serverless design relies on asynchronous communications, also called asynchronous connections.
Asynchronous connection reduces the number of application timeouts.
A timeout is a period of time when a user does not interact with the application.
Asynchronous connections lower the latency of HTTP responses.
Asynchronous connections make the user experience better.
Think Serverless Video
W3schools.com collaborates with Amazon Web Services to deliver digital training content to our students.
Simple Serverless Patterns
Simple Serverless Patterns are also called Event-Driven Patterns.
Event-driven code responds to an event, like a state change, and then the code is executed.
An event is a situation that can be triggered.
In an event-driven architecture, user experience and code execution are separated.
Separated entities communicate by asynchronous connections.
How Serverless Pattern Works
Information goes to the client through an Application User Interface (API) call.
The API call is an operation that your application can trigger and perform tasks.
The API call is served over the HTTP request.
Call responses and requests are handled by the Amazon API Gateway.
The logic that processes the call is inside a Lambda.
Storage for API call data is handled by Amazon DynamoDB.
Issues With Synchronous Approach
A synchronous approach in serverless architecture can present issues.
In synchronous code, operations can only happen one after another.
Scaling difficulties that happen are shown to the client.
When an error happens in Lambda, automatic call retries are not built-in.
It takes more time to develop and implement proper error handling in the front-end code.
You are responsible for implementing automatic call retries should API calls fail.
Asynchronous patterns should be used whenever possible.