search

Home  >  Q&A  >  body text

数据库 - 以下两种mongodb collection的设计哪种好一点?



这是一个关于员工请假的设计
需要有获取所有员工下的请假数据的需求
也会有获取单个员工下的请假数据的需求
请问哪一种比较好?还是应该只保存leaveId,leave新建一个collection?

高洛峰高洛峰2757 days ago563

reply all(1)I'll reply

  • 阿神

    阿神2017-05-02 09:22:44

    The second good point is that NoSQL makes the data flat and even has an appropriate amount of redundancy to reduce correlations, which can effectively improve efficiency. This is the so-called anti-paradigm design. The first type is more common in relational databases, which is the so-called paradigm design

    reply
    0
  • Cancelreply