Say I have a social website with a user
DB table. Later I decide to introduce an invite/referral feature by adding a new invite_link
field to the user
table. I am wondering how is the new field typically populated:
- Update the backend so that the
invite_link
value is generated upon new user registration. Then do a batch update for all legacy users. Finally update the frontend to expose the invite link to users. - Use
lazy loading
in the backend instead, i.e. fetch the invite link or generate one if empty for all users.
Which is a better or more popular approach? Thanks in advance!