Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Craig Rowe 22 posts 175 karma points
    Aug 15, 2016 @ 15:25
    Craig Rowe
    0

    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.

  • Amir Khan 1282 posts 2739 karma points
    Aug 15, 2016 @ 15:34
    Amir Khan
    0

    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

  • Craig Rowe 22 posts 175 karma points
    Aug 16, 2016 @ 07:19
    Craig Rowe
    0

    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.

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Aug 15, 2016 @ 15:46
    Nicholas Westby
    1

    Is use of descendants and linq performant?

    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).

  • Craig Rowe 22 posts 175 karma points
    Aug 16, 2016 @ 07:22
    Craig Rowe
    0

    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?

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Aug 16, 2016 @ 10:19
Please Sign in or register to post replies

Write your reply to:

Draft