a design trick

Scenario: The company is trying to direct customers to the app. Therefore, an activity plan was formulated:
when the customer logs in through the app, a coupon will be issued to the customer, but it can only be issued to the customer after logging in through the app, and there is no time limit. In this way, the technology has to design a table specifically to record whether the customer has logged in from the app. This coupon will be issued if you log in from the app.
This results in a waste of database queries: customers have to query this table every time they log in to see if the coupon has been issued, resulting in a huge waste of performance.

A female colleague modified the design. That is, when the customer registers, the coupon is issued to the customer, but the coupon is in the "inactive" state, and the user is prompted to "log in to the app to activate". Diversion to the app side, otherwise it means that there is no active diversion, and the coupons of users who log in to the app side are equivalent to being sent in vain.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326291035&siteId=291194637