【发布时间】:2018-12-22 23:10:32
【问题描述】:
我正在做一个关于买卖东西的项目,就像一个市场。我在我的项目中使用 React 和 Firebase。
问题是构建数据库的最佳方式是什么: 问题: 我当前的数据库是:
Root ---
---Users //data about the user: id, username, avatar, customer rating...
---SellData //include data about the Seller ads: title, price, description, image,...
---BuyData //include data about the Buyer ads: title, price, description, image,...
然后,在我的主页上,我想显示一个列表项,每个项都有以下信息:用户名、头像、客户评分、标题、价格。所以它是用户和销售数据的结合。
我是否应该将更多用户数据添加到我的 Root/SellData 或 Root/BuyData 中,因为这些文件只包含产品信息,而不是用户信息?但是如果我这样做,我的数据库在扩展时会非常大。 我的情况有什么不同的解决方案吗?
【问题讨论】: