1 個回答
- 最新
- 最多得票
- 最多評論
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.
已回答 7 個月前
相關內容
- AWS 官方已更新 1 年前
- AWS 官方已更新 1 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前
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
.