Refactoring to ServerlessDirect database access1 min

Description

When using Step Functions, if you use Lambda to read data DynamoDB ,then the application's topology hidden inside the function code. To see what database is being called you have to look inside the Lambda code.

Solution

Use Step Functions Integrations to execute read operations in DynamoDB and remove the need to invoke a Lambda function.

See the CDK implementation of this pattern in Typescript on GitHub.

Advantages

  • Removes the need to invoke a Lambda function to execute read operations in DynamoDB.

  • Simplifies the architecture and makes the integration explicit.

  • Improves performance and helps reducing response times and latency.

  • Lowers cost by reducing the use of cloud resources.

Limitations

  • It might not be applicable where the Lambda function performs a transformation before reading or after writing to DynamoDB.

Applicability

  • This refactoring can be applied to workloads that use Lambda functions is used purely to read.

Related Refactorings


Created by:

Gregor Hohpe
Gregor HohpeI contemplate and write about architecture strategy, cloud, and IT transformation. In between I - extract order from chaos - dive into the engine room to give the penthouse better IT strategies - fight relentlessly against unnecessary complexity and corporate politics I've been called the ''IT transformation jester'' - unbiased, trusted, influential, and witty.
Sindhu Pillai
Sindhu PillaiAs Regional SA Lead, I focus on enterprise Education Technology customers. In my role, I guide my SA team in the delivery and execution of complex technical solutions to support our customer's business and technical goals.
Bhuvan Annamreddi
Bhuvan AnnamreddiAssociate Solutions Architect, AWS