5
Views
0
Comments
[Amazon DynamoDB Connector] Thread safety concerns and suggested improvements
amazon-dynamodb-connector
Service icon
Forge asset by Guilherme Pereira
Application Type
Service

Hi, 

I reviewed the extension code and found a few areas that may be worth improving for production use:

  • Thread safety:
    • The singleton implementation and static credential storage are not thread-safe and could cause issues in a multi-user OutSystems environment.
    • For example:
      If two applications, A and B, both use this connector, they would override each other's Login calls, as the credentials are stored in the AmazonDynamoDB.Instance, which is a static (singleton) shared by all applications on the server. So if application A logs in with its credentials, then B logs in with different credentials before A does a GetItem of Query operation, then application A will be using B's credentials.
  • Credential handling: 
    • AWS access keys are stored globally in memory. This may lead to credential crossover between requests/users and is not aligned with current AWS best practices. 
  • Client lifecycle:
    • A new AmazonDynamoDBClient is created for every operation. The AWS SDK clients are thread-safe and intended to be reused. 
  • Pagination: 
    • Both Query and Scan only return the first page of results. DynamoDB can return additional pages via LastEvaluatedKey, so large result sets may be truncated. 
  • Exception handling: 
    • The code only checks HTTP status codes and does not handle DynamoDB/AWS-specific exceptions such as ResourceNotFoundException or ProvisionedThroughputExceededException. 
  • CreateTable: 
    • The current implementation only sets the table name and does not provide the required key schema/attribute definitions, so it is unlikely to work as expected. 
  • Region resolution: 
    • Using reflection on RegionEndpoint is fragile; RegionEndpoint.GetBySystemName() would be more robust. 
  • Missing features: 
    • Support for UpdateItem, batch operations, transactions, and conditional writes would make the component much more complete.

Overall, the component works as a basic DynamoDB wrapper, but there are some architectural, scalability, and security concerns that should be considered before using it in a high-volume or multi-tenant production environment. 

Thanks for making the component available on Forge. Hopefully this feedback helps with future improvements.

Kind regards,

Steven

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.