Skip to content

Instantly share code, notes, and snippets.

@ariesmcrae
Created August 27, 2023 11:37
Show Gist options
  • Save ariesmcrae/117ed0b6ee2157ed1db9d515c9248844 to your computer and use it in GitHub Desktop.
Save ariesmcrae/117ed0b6ee2157ed1db9d515c9248844 to your computer and use it in GitHub Desktop.
Direct S3 to Lambda vs EventBridge between S3 and Lambda

When should you use direct S3 to Lambda vs an EventBridge in between S3 and Lambda

S3 ==> Lambda 
    vs 
S3 ==> EventBridge ==> Lambda

TL;DR

If your use case is simple and you only need to trigger a Lambda function when a new file is added to an S3 bucket, a direct S3 to Lambda integration is likely sufficient. If you have more complex needs, then introducing EventBridge might be beneficial.

When Direct Integration is Sufficient:

  • Single Consumer: If only a Lambda function needs to be triggered.
  • Simple Use Case: If you don't require complex routing or event transformation.
  • Low Latency: If you need the Lambda function to execute as quickly as possible after the S3 event.
  • Cost Sensitivity: If you want to minimize additional costs.

When to Use EventBridge

  • Multiple Consumers: If the S3 event needs to trigger multiple services, not just a Lambda.
  • Complex Routing: If you need more complex routing than S3’s basic prefix/suffix filtering.
  • Event Transformation: If you need to modify the event before it reaches Lambda.
  • Event Replay and Archiving: If you need these features for debugging or auditing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment