Default Design for Single Table Database
This shows a potential storage structure for a NoSql style database – I have recorded a series of lectures on this at Topic – Creating a Single Table Database Object Storage
The single table database is a simple database design that allows you to store data simply in a data table and define different types of data without having to create a new database table for each type of data. The design is similar to a NoSQL database . There is only one basic table in the database with the following schema;
CREATE TABLE [dbo].[DataStore](
[id] [int] PRIMARY KEY IDENTITY(1,1) NOT NULL,
[DescriptionText] [nvarchar](250) NULL,
[DataText] [nvarchar](max) NULL,
[DataTypeText] [nvarchar](250) NULL,
[UserName] [nvarchar](250) NULL,
[CreatedDate] [datetime] NULL)
id – A primary key set as an identity, used by the system to quickly retrieve a single record.
DescriptionText – A reference description to allow for easy searching of the data stored in data text.
DataText – The actual text of the data, normally stored as XML – but flexible enough to be stored as any type of text.
DataTypeText – Enumeration of different types of data that will be stored. This allows for determination of the schema for XML data, the format for each type of DataTypeText will be determined by the programmer.
UserName – The identity determined by login and Membership for the user saving the data.
CreatedDate – Exactly what it states it is.