Best practice for user generated content creation/retrieval
If Umbraco is being used as the basis of a web application where members can create/edit/view lists of their own content (shared with a subset of other members) are there any issues with using standard Document Types for this (as opposed to custom SQL) such as performance?
In addition, in this scenario the answer to the question "List me all of my projects" where project is a document type and 'my' is the CreatorId or some other field. Is the retrieval of this best performed via:
IPublishedContent API e.g. Model.Content.Descendants(Project.ModelTypeAlias).Where(p => p.CreatorId == currentUserId)
Examine
Is use of descendants and linq performant? With user generated content the database could become very large. Pulling all descendants of type then in memory filtering would seem like a poor choice?
Are there examples of Umbraco being used as an application base in this way rather than just CMS pages controlled by a small set of backend users.
Hi Craig, might want to take a look at the repository below. The code for Our is actually open source and a lot of your questions were likely addressed during its build: https://github.com/umbraco/OurUmbraco
Nope, it has historically been fairly slow. Can take a second or two on a site with thousands of nodes.
I would recommend storing any user-generated content in an entirely different database. That way, if the client ever needs to do a content freeze (e.g., during a major Umbraco upgrade), it can be more easily accomplished (trying to get site visitors to not perform edits is more challenging).
Also, a different database allows you do do things like make a bunch of changes on a staging environment, the completely overwrite your production Umbraco database without losing any user-generated content. It would also allow you to backup your production Umbraco database to overwrite your dev/stage databases without getting any of the user-generated content (sometimes important if that user-generated content contains anything that requires special regulation).
That isn't to say there isn't a good reason to add user-generated content to Umbraco as content nodes. For example, if you want the ability to edit that content in the native back office interface, you might consider adding it to Umbraco content.
As a cautionary tale, uBlogsy/uCommentsy stores comments as content nodes in Umbraco. There is a dashboard that displays comments that haven't been approved yet. This dashboard appears when you log in. On some sites, I have seen this dashboard take minutes to load, and it pegs the CPU during that entire time. And keep in mind this takes place any time somebody logs in to Umbraco (I ended up having to remove that dashboard entirely).
What kind of support does Umbraco offer for going down the custom tables route? Is the developer left with pretty much making a separate web application that happens to be exposed through user controls/child controllers or does Umbraco expect this kind of work an offer easy hooks into an ORM or the backend edit screens/property editors?
Best practice for user generated content creation/retrieval
If Umbraco is being used as the basis of a web application where members can create/edit/view lists of their own content (shared with a subset of other members) are there any issues with using standard Document Types for this (as opposed to custom SQL) such as performance?
In addition, in this scenario the answer to the question "List me all of my projects" where project is a document type and 'my' is the CreatorId or some other field. Is the retrieval of this best performed via:
Is use of descendants and linq performant? With user generated content the database could become very large. Pulling all descendants of type then in memory filtering would seem like a poor choice?
Are there examples of Umbraco being used as an application base in this way rather than just CMS pages controlled by a small set of backend users.
Hi Craig, might want to take a look at the repository below. The code for Our is actually open source and a lot of your questions were likely addressed during its build: https://github.com/umbraco/OurUmbraco
Hope that helps,
Amir
Am I right in saying that Our Umbraco uses it's own data tables? projectContributors for example looks like a table it is directly querying.
Nope, it has historically been fairly slow. Can take a second or two on a site with thousands of nodes.
I would recommend storing any user-generated content in an entirely different database. That way, if the client ever needs to do a content freeze (e.g., during a major Umbraco upgrade), it can be more easily accomplished (trying to get site visitors to not perform edits is more challenging).
Also, a different database allows you do do things like make a bunch of changes on a staging environment, the completely overwrite your production Umbraco database without losing any user-generated content. It would also allow you to backup your production Umbraco database to overwrite your dev/stage databases without getting any of the user-generated content (sometimes important if that user-generated content contains anything that requires special regulation).
That isn't to say there isn't a good reason to add user-generated content to Umbraco as content nodes. For example, if you want the ability to edit that content in the native back office interface, you might consider adding it to Umbraco content.
As a cautionary tale, uBlogsy/uCommentsy stores comments as content nodes in Umbraco. There is a dashboard that displays comments that haven't been approved yet. This dashboard appears when you log in. On some sites, I have seen this dashboard take minutes to load, and it pegs the CPU during that entire time. And keep in mind this takes place any time somebody logs in to Umbraco (I ended up having to remove that dashboard entirely).
What kind of support does Umbraco offer for going down the custom tables route? Is the developer left with pretty much making a separate web application that happens to be exposed through user controls/child controllers or does Umbraco expect this kind of work an offer easy hooks into an ORM or the backend edit screens/property editors?
Hi Craig,
Umbraco has own ORM, read more - https://creativewebspecialist.co.uk/2013/07/16/umbraco-petapoco-to-store-blog-comments/
is working on a reply...