doumu1873 2018-09-28 09:42
浏览 33
已采纳

为每个商家分配在线库存系统的数据库是否合适? [关闭]

For example, Company Abc will have it's own database: Database_Abc.

Let's say each Database will consist of the following tables:

  1. staffs
  2. products
  3. inventory
  4. logs

or

one centralized database with unique merchant id would be better?

  1. staffs - merchant_id
  2. products - merchant_id
  3. inventory - merchant_id
  4. logs - merchant_id

which method is good for scalability?

  • 写回答

2条回答 默认 最新

  • duandu8707 2018-09-28 10:41
    关注

    Well, it's not just a question about database management but also a server-side applications thoughts.

    1. Starting from a scratch one centralized DB with uniform server-side application will do the trick nicely and in case of horizontal increase of data will scale almost perfectly

    2. If you have various and very different requests per each company you'll need to think about implementation for each company with it's own design. Such approach consumes more resources but will fit individual customers

    Speaking of database management you'll need to ask yourself following questions

    1. What type of data will be stored? You should keep in mind that storing financial data best fits for DECIMAL type for example.
    2. Think about relations between tables - thus think about correct FOREIGN KEYs for example.
    3. Think about possible shortcomings of MySQL itself - for example, it's not suited well for full-text search
    4. How your data will increase in size? If it will increase very rapidly, you will need to think about PARTITIONING for example
    5. Think about replication and backup issues.
    6. Where will you host your database? You can think about cloud services thus not thinking about administration etc.
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?