Question

I have been writing an application using ASP.Net MVC4, where the majority of the data has been stored in MongoDB. This has worked great for the majority of what I would consider the "meat" of my application, the functionality it was made for that sets it apart.

However, now I need to add static content and administrative capabilities (setting up accounts, billing, help, etc). I'm strongly inclined to use Orchard CMS to handle all of this functionality, and then migrate what I have done so far into Orchard modules.

The question is this: How much of my data should I be using Orchard's Content Types to model? I plan to continue to store at least some of my data in Mongo, so now I am unsure of where to put the dividing line between what goes where.

Have you implemented a web application in Orchard before? Where did your domain data go? If you used Content Types, were there any lessons learned?

Was it helpful?

Solution

Why do you want to keep using MongoDB? In Orchard all data access is done by NHibernate, using xxxRecord classes where a virtual property is mapped to a column. It works with SQL Compact, SQL Server 2008 (and R2) and SQL Azure.

I don't know the status of RavenDB, but there might be a module using RavenDB for storing blob data or just using it as no-sql data storage.

Personally i would not use multiple data storages.

A ContentType contains multiple 'attachable' ContentParts and ContentFields, either in code or else using the orchard admin user-interface. U can use repository's if u want, but only do that for data that is not directly a ContentPart. The DefaultContentManager has versioning, publishing, deleting, etc.. If u delete a ContentType it just get a flag that it has been deleted. (unless u use some another module that executes delete statements) Using repository's there is a risk u think the item still exists while it does not.

As final answer to your question: Yes, you should use ContentType's as domain model, and u do not have to worry about the differend query's being executed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top