开发者

What database design for an enterprise cloud service

I'm planning a database for an enterprise cloud service. The service will be two web applications, one Warehouse management system and one for Invoices.

Companies can signup and become a "user" of the service, then they can have their Inventory and Invoice system online.

Should I keep all users/companies in the same table or should I have one table/application per user? It would be much easier to maintain if all users/companies use the same database table, but I 开发者_如何学Cthink it would be easier to implement the serial number on invoices if I use one table per user/company.

The Inventory/Warehouse will contain up to 5,000 items per user/company.

Each Invoice are required to have a serial number, starting from 1 for the first invoice. So an Auto-Increment-column would be a good idea, if I have one table per user/company. Or how should I solve it if I put all companies in the same table and use a company_id-column?

How should I design the database for such an application? I will use MySQL as DBMS.


starting from 1 for the first invoice: that's probably not a good idea. Potential customers probably had a life before they join your service.

how should I solve it if I put all companies in the same table: just calculate the MAX of InvoiceId FOR THAT CUSTOMER, then increment it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜