Copied to clipboard

Flag this post as spam?

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


  • Khai 71 posts 161 karma points
    Oct 15, 2012 @ 21:34
    Khai
    0

    How to setup a business ( data ) layer in Umbraco?

    I'm new to Umbraco and I am planning on doing a project with it. After reading through some documentation, I still have no idea how to create my architecture.

    I'm planning on building a website that has a forum and is mainly focused on videos ( youtube videos ). The website will also need to create top rated lists of the videos. And users can rate and comment on videos aswell. ( I'm planning on having a lot of videos )

    So the idea is to have these entities:

    Videos

    • ID
    • CategoryID
    • Title
    • Description
    • URL1 ( url to youtube )
    • URL2
    • URL3
    • URL4
    • URL5
    • Tags

    Categories

    • ID
    • Title

    Ratings

    • VideoID
    • UserID
    • RateValue

    Comments

    • VideoID
    • UserID
    • Comment

    So does anyone have ideas on how to implement this in Umbraco? Should I use a seperate external DB for these entities? Or should I use document types? The document type looks pretty powerful but it feels weird to create a document type for the ratings or comments. 

     

     

  • julius 107 posts 289 karma points
    Oct 17, 2012 @ 00:50
    julius
    0

    You could do it using just document types by adding Ratings under videos for instance. But I agree it's weird. What you have is a relational database design and you are trying to apply it to a tree structure. 

    You could use a combination of the two. Why not create Category, Video and Comment document types and store ratings in a separate database table that stores the ratings? 

    I'd try to keep the actual "content" of your site as document types in Umbraco and I wouldn't consider a rating content. It is more some time of meta data. That is, information about your content. That is how I think about it when I discuss this type of question with myself. There might be better solutions/views, because my knowledge of Umbraco is pretty limited.

  • Khai 71 posts 161 karma points
    Oct 17, 2012 @ 00:58
    Khai
    0

    thanks for your reply Julius. Yes, I totally agree about hanging metadata under a tree structure, it just doesn't feel nice. So, what you are suggesting is creating your own tables in the db of umbraco? I've thought about it aswell but I don't know if this is a best practise. If anyone else has more/better ideas on implementing this, please share this with me! :)

  • julius 107 posts 289 karma points
    Oct 17, 2012 @ 01:40
    julius
    0

    This is a pretty interesting question btw.

    Get this: when you want each video to be in just one category (like in your data model), than you could just use the hierarchical tree structure that Umbraco offers for categorizing your video's.You'd set up a tree structure of category types and move each video under one of the categories.

    But this is not entirely necessary or even wanted if you want to allow a video to be able to exist in multiple categories. In this case you could create a "video" folder and put all your video's there in a list and besides that you create a separate "categories" tree structure. Then you could have the editor assign multiple categories to each video using a "multiple content picker" in the video document type. 

    I'd go for the latter option, because it's more flexible, combined with separate db tables for storing ratings, since they don't need any management and their numbers can grow huge which would make them hard to manage from the Umbraco interface.

    Ok, if anyone has an alternative solution, I'd be happy to hear it too. Bookmarked.

Please Sign in or register to post replies

Write your reply to:

Draft