简体   繁体   English

我应该为此用例创建一个单独的表吗?

[英]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). 我需要在第三方平台上注册我的一些商家,为此我需要发送商家详细信息以及请求参考号(rrn)(对于每个入职请求都是唯一的)。 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. 入职后,商人是否实际入职将由单独的验证api完成,这将要求我发送请求参考号。
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? 问题是,是否应该在已经存在的商人表中添加新列,还是应该创建一个单独的表来映射带有请求rrn的商人_ID,因为只有5%的商人将加入该第三方?

只要商人表很小(小于一百万),就可以在表中添加一列并为其编制索引

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. 如果您管理流程,而商家只是告诉您他们已入职,则将信息存储为标记是可以的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM