开发者

MongoDB Data Modelling

I'm a .NET developer developing on ASP.NET MVC, SQL Server 2008 and Entity Framework 4.1 using Model First Approach.

I'm interested in switching to MongoDB as I think it suits my project better (the reasons for this are beyond the scope of this question).

My question is - how do I go about modelling my Domain in MongoDB ? For instance, I loved in VS 2010 modelling my data using E开发者_Python百科DM and generating my POCO classes. Is there a similar tool/approach that anyone has used for MongoDB or is it just a case of getting out the ol' pen & paper ? I'm a complete newbie to MongoDB so any opinions/insights are appreciated.

Ciaran


First of all mongodb is schema less database. So in entity framework code first approach you first declare model than generate from it database. In mongodb you just need declare models, then you can store it in mongodb as is. Also you no need to alter database table when you need add some field, nested collection, etc. into some collection. You just need add new fields into your model.

In my opinion best things to design right mongodb schema design it's:

  1. Pen & paper or whiteboard
  2. Strong knowledge of project: business logic, purpose of project, etc. So you need know and understand everything.
  3. Visual studio to create models (simple classes).
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜