1 Antwort
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
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.
beantwortet vor 7 Monaten
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor einem Jahr
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
.