Book Image

ASP.NET 3.5 Social Networking

By : Andrew Siemer
Book Image

ASP.NET 3.5 Social Networking

By: Andrew Siemer

Overview of this book

Table of Contents (19 chapters)

Solution


Let's take a look at our solution.

Implementing the database

First let's take a look at the tables required for these features.

Files

The most important thing to consider storing in the database first is of course our primary interest files. As with most other conversations regarding a physical binary file we always have to consider if we want to store the file in the database or on the file system. In this case I think it makes sense to store the file (and in the case of a photo, its various generated sizes) on the file system. This means that we will only be storing metadata about each file in our database.

The most important field here to discuss is the FileSystemName. As you can see this is a GUID value. We will be renaming uploaded files to GUIDs in addition to the original extension. This allows us to ensure that all the files in any given folder are uniquely named. This removes the need for us to have to worry about overwriting other files.

Then we see the FileSystemFolderID...