Best Practices for Storing and Updating Coupon Data in XDM Schema as a "Array"
Hello everyone,
I'm in the process of designing an XDM schema to catalog users' coupon statuses and I'm seeking advice on field type selection and data update strategies.
1. Coupon Field Type: To store a user's redeemed and unredeemed coupons, is it advisable to use a field type of string with the "Array" option enabled? This would allow me to keep a list of multiple coupon codes within redeemed_coupons and unredeemed_coupons fields, respectively.
2. Updating Coupon Data: Our integrated coupon system provides daily updates of the latest coupons records for each user, say the records of redeemed_coupons and unredeemed_coupons. How can we efficiently add (stack up) just these new coupon codes to the existing redeemed_coupons array in the user's profile while ensuring that we do not introduce duplicates due to former ingested coupons?
For clarification, consider this scenario: on day 1, the array redeemed_coupons is populated with [123456, 223456, 333456]. On day 2, the system updates the same user's redeemed_coupons with [423456, 523456]. Will the day 2 data overwrite the day 1 data?? Resulting in redeemed_coupons solely the latest record of [423456, 523456]?
I would greatly value any insights or recommendations regarding field setup and data ingestion practices.
Thank you,
Rap