1 Answer
- Newest
- Most votes
- Most comments
0
If you want to use S3, I think you can store orders that belong to a customer in a folder based on customer ID. e.g.,
your-bucket/ customer1/ order1.json order2.json customer2/ order3.json
and run ListBucket('your-bucket', 'customer1') to get all orders for a specific customer.
However, if possible, I would prefer store order data in NoSQL database (e.g., DynamoDB) with the customer ID set as a primary key.
answered 7 months ago
Relevant content
- Accepted Answerasked 2 years ago
- asked 7 months ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
Thanks - that's a good idea. However - how do I link the caller with the customer Id's?
Generally, a customer ID should be able to retrieved from its authentication token. For example, if you use Congito User Pool as an user authentication service, you should decode the request sender's ID token which can be retrieved from Lambda input context.identity.cognitoIdentityId. The decoded ID token should look like this:
Then you can decide that the authenticated request sender has the customer ID
customer1
.