Umesh Malhotra
Umesh Malhotra

Reputation: 1047

Should I create a separate table for this use case?

I need to onboard some of my merchants on a third party platform, for which I need to send merchant details along with a request ref no.(rrn) (unique for every onboarding request). After onboarding, whether the merchant actually got onboarded or not will be done by a seperate verify api, which will require me to send request ref no.
The question is whether I should add a new column in my already existing merchants table or should I create a separate table for mapping merchant_id with request rrn, given that only 5% of merchants will be onboarded on this third-party?

Upvotes: 0

Views: 130

Answers (2)

Sameer
Sameer

Reputation: 371

As long as the merchants table is small (less than 1 million), you can just add a column to the table and index it

Upvotes: 1

Gordon Linoff
Gordon Linoff

Reputation: 1269773

I would suggest that you store this information in a separate table. You have described a simple scenario, but the actual scenario might be more complicated:

  • There is a timelag between starting the on-boarding and it being successful.
  • Perhaps the onboarding is not successful.
  • If a merchant can be "onboarded", they can be "offboarded".
  • And then onboarded again.

In other words, if you are managing the process, you should keep track of each of the possibilities.

If you are not managing the process and the merchant simply tells you that they are onboarded, then storing the information as a flag is fine.

Upvotes: 0

Related Questions