Function as a Web Service

In the beginning was the Lambda


function-as-a-web-service

Context

Serverless architectures are all about building and composing services. Services should be maintainable, testable, independently deployable, and loosely coupled with other services. Lambda functions provide the foundation for provisioning and deploying services that execute business logic.

Solution

Services are provisioned and deployed as Lambda functions. Use API Gateway to expose Lambda functions as RESTful HTTPS endpoints. API Gateway maps the incoming HTTPS context and request data to an event that is passed to the Lambda function

Components

API Gateway

API Gateway exposes an HTTPS endpoint and maps requests to the integrated service.

Lambda Function

A Lambda function handles business logic and returns JSON data encapsulating HTTPS Status Code, Headers and a message Body.

Notes

Direct invocation of Lambda functions creates coupling between our services. Consumers that rely on directly invoking a function are coupled to the internal implementation of the service.

Map API Gateway endpoints to a custom domain to further decouple services and allow teams to evolve the internal service architecture independently.


Cost Profile

ServiceCharge
API GatewayRequest
API GatewayData Transfer
LambdaRequest
LambdaCompute Time x Memory
CloudWatchLog Data Ingestion