Skip to content

Instantly share code, notes, and snippets.

@Toshakins
Last active February 12, 2020 21:30
Show Gist options
  • Save Toshakins/2e8c614af6d7ee59c52ee769ee94d92f to your computer and use it in GitHub Desktop.
Save Toshakins/2e8c614af6d7ee59c52ee769ee94d92f to your computer and use it in GitHub Desktop.
FaaS providers thoughts

Architectures

Compute as glue

Glue several services together with FaaS. Example: direct S3 upload triggers a function which invokes Rekognition, after that the result is saved by another function to the DynamoDB.

Backends

Literally the architecture that responds to HTTP calls. Youcan organize it in various ways too.

  • One function for whole service
  • Several functions for the service
  • Microservices -- lots of services that incorporate function
  • Backendless -- business logic is done on the frontend, and serverless services are used through the API for various needs(authentication, storage, transcoding).

Streaming

Functions process shards of data(?). Shard is about a several megabytes and represents small batch of data. Streams can be replayed.

Edge computing

Function is executed in between client and origin server.

  • Very asynchronous, so much notifications.
  • Integrations with VSCode is awesome! I can get env variables from cloud to IDE and backwards!
  • Error calling sync triggers. This is some error happening while publishing your code. Github issues are full of people who experience that: https://github.com/Azure/azure-functions-core-tools/issues?utf8=%E2%9C%93&q=is%3Aissue+Error+calling+sync+triggers
    • Moreover, usually fix done my MS people somewhere deep in the cloud, so customers are doing nothing wrong. Sad!
  • No need for API Gateway to see the function working!
  • Embedded tools are much easier than AWS.
  • Whoa, very easy!
  • No need to set API gateway for testing.
  • I like Google's documentation!
  • Storage rules looks tricky
service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write: if request.auth!=null;
    }
  }
}
  • Embedded tools are much easier than AWS.

Orchestration patterns

  • Pipe and filter
  • command(invoke other function)
  • fan in(gather all into one)
  • fan out(spread out)
  • Step orchestration(image recognition system)

Messaging patterns

  • Queue/Stream
  • Priority Queue(convert premium videos over free)
  • Pub/sub

API patterns

  • API Gateway (sync/async
    • async returns job number or queue id
  • Proxy
  • GraphQL(AWS AppSync)

Vectors

  • Data about users(identity theft, credential reuse, security question answers)
  • DoS(vandalization, showing off skills)
  • Ransom and blackmail(data hostage, publishing internal docs)
  • Payment information(gift and credit cards, billing information)
  • Free stuff(Fake orders, free ads, free bandwidth or computing power)
  • Specific user info(location, purchase history, messages)
  • Targeted abuse(bulling, abusive partners or behavior)
  • Stalking(harassment, recon for other attacks)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment