存储共享公共属性的实体

时间:2017-07-01 12:08:45

标签: mongodb mongoose mean-stack

我是Mongodb的新手。

目前我正在使用MEAN堆栈进行项目。我使用模式较少的方向来存储数据,即mongodb作为客户端而不是mongoose。

在我从互联网上进行研究之后,我发现与基于模式的nosql数据库相比,模式较少的数据库执行(速度),因此决定了模式较少的方法。

我面临的情景:

我有几个共享公共属性的实体。假设实体A具有名称,位置,电话号码,实体B具有与A的属性相同的其他属性。

假设考虑我的应用程序将扩展到10亿用户

讨论上述情景的问题

1) Is it better to store as different collection for different types 
   or prefer inheritance type of approach for storing those entities.
   If inheritance type is preferred how it is done in mongodb.

很少有其他一般性问题(考虑到大的可扩展性)

1) Is my schema less approach right choice 
2) Is it better to use ODM tool or directly write code in my dao 
   layer to access the database without using object approach

许多人可能觉得这完全超出了mongodb的范围,我从设计和性能的角度来看这个问题。

因此需要使用mongodb进行大规模应用程序开发的专家提供建议。

0 个答案:

没有答案
相关问题