Copied to clipboard

Flag this post as spam?

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


  • E.J. Brennan 73 posts 114 karma points
    Feb 23, 2011 @ 15:08
    E.J. Brennan
    0

    Where to store custom data?

    Working on a new project in umbraco (4.6.1). I've already written some asp.net user controls, that worked with the existing umbraco node-type data to give me the custom rendering Ineeded.

    But now I want to add some client specific data that will be updated thru an asp.net custom controlform and saved to a database for later publishing and/or creating printed reports down the road.

    The question is, if you are trying to be true to the umbraco way of doing things, should I be attempting to store all my custom data items directly into the umbraco data tables, or should I simply create my own custom table(s) and treat them like just like I would if the code was not running under umbraco?

    Hope my question is clear - I think the answer is technically I could do either and both would work, but I am trying to not accidentally do things that will have adverse side-effects down the road.

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Feb 23, 2011 @ 15:58
    Ismail Mayat
    0

    I have seen instances where people create their own custom tables in the umbraco db but have also seen people creating separate databases to store custom data i have tended towards the first instance but thats just me being lazy.

    Regards

    Ismail

  • Jonas Eriksson 930 posts 1825 karma points
    Feb 23, 2011 @ 16:03
    Jonas Eriksson
    0

    I'd appreciate a simple package that adds a CustomData table with just key - value columns and some crud functionality. I'd write one myself if I just got myself started.

  • Kim Andersen 1447 posts 2197 karma points MVP
    Feb 23, 2011 @ 17:31
    Kim Andersen
    0

    I think  would go for the method of just creating a custom table inside the Umbraco database. Then we have everything in one place, and don't have to take care of more than one DB.

    /Kim A

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 23, 2011 @ 18:45
    Jan Skovgaard
    0

    This is an interesting topic...I think it requires some deep thought. If it's something that is customized for only one particular installation then it's probably the most easy and maybe best to just add another table in the Umbraco database.

    But what if what one is doing is a plugin that can be used in other situations as well outside of Umbraco? And what if it's something that needs to be reused on multiple umbraco installations? Would'nt it then make sense to keep it in it's own database?

    /Jan

  • Tony 5 posts 25 karma points
    Feb 23, 2011 @ 19:12
    Tony
    0

    i'm with jonas! a generalized package installer would be great, but i suspect that the reason a dev would need to go this route is because the data objects and relationships that need to persist are too funky for generalized methods.

    i personally feel much more comfortable using my own data access layer that i've developed over the years. granted i'm 1 week new to umbraco, but the xlst make my head spin. so long as i have (read only... i'm okay with that) data access to important properties on the current page in the correct context, my user control can then take those values and do whatever i want it to do on the insert/update and i can juggle and join that data with other data in a very traditional ado.net way. it's probably not the umbraco way but it's the way i'm honestly most comfortable in. but that's why this cms is so great... we can both be right! i just hope i never have to work on your stuff :)

  • Richard Soeteman 4049 posts 12922 karma points MVP 2x
    Feb 23, 2011 @ 20:22
    Richard Soeteman
    0

    Hi,

    If the database tables are only needed for your Umbraco site, I would create them in your Umbraco database. I always use a prefix for my custom tables so you can easy identify the custom tables.

    Just my 2 cts

    Richard

     

     

  • Benoit Paquin 1 post 21 karma points
    Oct 08, 2011 @ 13:10
    Benoit Paquin
    0

    Hi,

    As an example, where would you put a property that count the number of time a node as been fetched?

    Personnaly I would like to simply add it to the document type and update it in code, but I have to publish it and then the node history will grow endlessly...

     

    Benoit

     

Please Sign in or register to post replies

Write your reply to:

Draft