Skip to content

Instantly share code, notes, and snippets.

@geez
Last active June 15, 2022 13:37
Show Gist options
  • Select an option

  • Save geez/9b5439606b4d8fd5ef53d412ca037aff to your computer and use it in GitHub Desktop.

Select an option

Save geez/9b5439606b4d8fd5ef53d412ca037aff to your computer and use it in GitHub Desktop.
# Serverless principles
# General design principles to facilitate good design in the cloud for serverless applications
* Speedy, simple, singular:
Functions are concise, short, single purpose and their environment may live up to their request lifecycle
* State Machines for Orchestration:
Chained Lambda within code = Monolithic app vs using a state machine to orchestrate transactions and communication flows.
* Think concurrent requests, not total requests:
Serverless applications take advantage of the concurrency model, tradeoffs at design level based on concurrency
* Share nothing:
Function runtime environment and underlying infrastructure are short-lived
* Assume no hardware affinity:
Underlying infrastructure may change. Leverage code or dependencies that are hardware-agnostic
* Orchestrate your application with state machines, not functions:
Chaining Lambda executions within the code vs using a state machine to orchestrate transactions and communication flows
* Use events to trigger transactions (asynchronous event behavior = lean service design):
Events such as writing a S3 bucket or a database allow for transaction execution in response to business functionalities.
* Design for failures and duplicates:
Operations triggered from requests/events must be idempotent. Include appropriate retries for downstream calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment