Need help (in my design) : Facts : F#1 : I shall have 1 Class, say UserOTPStore. This will will st
Need help (in my design) :
Facts :
F#1 : I shall have 1 Class, say UserOTPStore. This will will store 6-digit OTP as Key and Timestamp (of expiration) as Value.
F#2 : User shall be identified by "mobile number"
Implementation :
1. User requests OTP. Create DO with "mobile_number" and store OTP and Timestamp inside respective DO.
Please confirm my understanding for following Qs :
Q#1 : How to fetch ALL user for whom DOs has been created (with persistent data) ?
A#1 : Use DO-API : "/accounts/{account_id}/workers/durable_objects/namespaces/{id}/objects"
Q#2 : How to fetch data stored for ALL Users :
A#2 : Loop through the list of DO-IDs received from A#1, and call stub for each DO-ID (assume a function dump_stored_data() is part of the UserOTPStore Class)
Q#3 : How to clean-up / delete ALL Users data ? (basically, remove everything related to DO UserOTPStore Class)
A#3 : NO simple way. Need to use approach for A#2.
PLEASE suggest a simple O(1) operation, (as approach taken for delete based on A#2 will be really costly)
Thanks in advance for kind consideration in answering/confirming my Qs.
Facts :
F#1 : I shall have 1 Class, say UserOTPStore. This will will store 6-digit OTP as Key and Timestamp (of expiration) as Value.
F#2 : User shall be identified by "mobile number"
Implementation :
1. User requests OTP. Create DO with "mobile_number" and store OTP and Timestamp inside respective DO.
Please confirm my understanding for following Qs :
Q#1 : How to fetch ALL user for whom DOs has been created (with persistent data) ?
A#1 : Use DO-API : "/accounts/{account_id}/workers/durable_objects/namespaces/{id}/objects"
Q#2 : How to fetch data stored for ALL Users :
A#2 : Loop through the list of DO-IDs received from A#1, and call stub for each DO-ID (assume a function dump_stored_data() is part of the UserOTPStore Class)
Q#3 : How to clean-up / delete ALL Users data ? (basically, remove everything related to DO UserOTPStore Class)
A#3 : NO simple way. Need to use approach for A#2.
PLEASE suggest a simple O(1) operation, (as approach taken for delete based on A#2 will be really costly)
Thanks in advance for kind consideration in answering/confirming my Qs.
