Reputation: 557
What I want to do is that in umbraco I will create manually a profile for user. After that the user can update this profile. This is simple, isnt it ? But here comes the complex part. Each user should be able to add posts which will be displayed on his page and also update his gallery. Has anyone done anything similar to this? I bet yes ! What are the best practices ?
Thanks guys.
PS: I'm using Umbraco 7 and Razor.
Upvotes: 0
Views: 202
Reputation: 10400
The key question here is: How many users are you expecting?
Users
If we are talking about a few hundred, I would recommend just using Umbraco's members API and add extra fields to cater for the additional data the profile needs. This way, all member data can be accessed via the CMS member's area.
If the user base is going to be in the thousands, I would consider "rolling your own" membership (e.g. using and extending .Net's SimpleMembershipProvider
). The reason for this is that when you get above a certain size of user base you have to consider data access and load on the database etc. but also management of the user data.
Loading a member record from Umbraco would require a call to the API which would in turn require several calls to the database (retrieving the node, the properties and property values etc.). So you having a much more streamlined architecture in place would serve the site better when the user base increases past a certain point. Imagine you had 100s of users logging in and using your site throughout the day. Calls to the database would be high especially if you didn't use some caching like Redis.
Also consider running reports on your users. Running a report on the member API could be quite a costly process but not so if you used a membership provider.
Finally, I would consider security as well as data management. You could store all your member information in a separate database including posts and media references. This way your Umbraco install remains clean but also your user data remains a separate.
Posts and media
As far as user's posts and media goes - again, avoid storing this in Umbraco if you can. Personally, I try to separate content that belongs to the site from content belongs to a third party, e.g. users.
This is because storing a user's posts and media in the CMS adds unnecessary strain and bloat to the CMS for little gain. There is also a security issue too. In order to store user-generated content in the CMS you need to provide a form that allows a user to post directly into the CMS. If not careful, this can then be used to spam the CMS. A developer I worked with recently built (against advice) a public-facing "comments" form that created comment nodes directly in the CMS content tree. Of course the inevitable happened and the project management team spent the first part of each morning laboriously deleting dozens of spam nodes from the CMS.
The beauty is that whichever solution you choose, Umbraco is flexible enough to deal with it. For example it is easy to create datatypes that would allow selection of users from a separate database.
So, lots to consider!
Upvotes: 1