https://github.com/raiszo/dynamodb-lambda-example
CRUD with dynamodb implementing the repository patter for educational purposes
https://github.com/raiszo/dynamodb-lambda-example
aws cdk crud dynamodb lambda
Last synced: 9 months ago
JSON representation
CRUD with dynamodb implementing the repository patter for educational purposes
- Host: GitHub
- URL: https://github.com/raiszo/dynamodb-lambda-example
- Owner: Raiszo
- Created: 2021-10-15T03:40:37.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-17T09:26:34.000Z (about 4 years ago)
- Last Synced: 2025-01-25T22:42:43.496Z (11 months ago)
- Topics: aws, cdk, crud, dynamodb, lambda
- Language: TypeScript
- Homepage:
- Size: 179 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dynamodb-lambda-example
# Use cases
- create customer
- get customer by email (pk)
- get customer by document number and document type
- update a customer
- delete a customer
# Considerations
- We need uniqueness by email, which is guaranteed by the partition key, and by document, the latter being difficult because of how dynamodb works. To have a second truly unique column the implementation from [this](https://aws.amazon.com/es/blogs/database/simulating-amazon-dynamodb-unique-constraints-using-transactions/) blogpost was followed.
- The schema that is exposed thorugh the api is different from the on that the db uses. In the api `document_number` and `document_type` are different attributes but in the database they are merged into a single one: `document`.
# TODO
- Better error handling, there is only a 404 response when a customer is not found.
- Include error response in the response models for a better documentation.