I'm creating a discussion forum (of sorts) in ASP.NET MVC, and I have a requirement to allow posts by unregistered visitors. Visitors only need to specify an alias to post, and can optionally provide an e-mail address and a website url.
What's the best practice in handling posts by unregistered users in a database?
I'm a bit of a newbie in database design, but these options come to mind:
- Insert new record in the Users table for each post by an unregistered visitor. (Would make queries easier when records in Posts and Users tables will have a 1-to-1 relationship, but bloats the Users table)
- Create new table for unregistered users, and create new entries for new alias-email-url combinations, reuse existing ones. (In such scenario, would I have two foreign keys in the Posts table for RegisteredUserId and UnregisteredUserId?)
- Add UnregisteredAlias, UnregisteredEmail and UnregisteredUrl fields directly to the Posts table. (Awfully denormalized, but then again this seems like a clean solution to me. Would I then make the UserId field of the Posts table nullable, and set it to null for these posts?).
- The obvious solution I haven't yet thought of?
Would any of these solutions cause problems with mapping LINQ To SQL?
Edit:
To clarify, I do need to store an alias (a name), and an optional email address and url for each post made by an unregistered visitor. This information is displayed with the post, so visitor != anonymous in this case.