Question

For a web application whose sole purpose is to allow users to upload raw file data at any time (to database tables), does a transactional or dimensional model make more sense for such an application?

Some reporting is done off the data at this time but it is very minimal. If that changes in the future (such that reporting becomes more pervasive), does that change the model you suggest?

Total space for the database 100GB.

Was it helpful?

Solution

It depends on your data, and how you want to store it and access it later to report off it. Your database itself doesn't need to be geared specifically to one or the other, rather you can have tables that are transactional, dimensional, or simultaneously both depending on your use case.

In general, if you're doing some sort of reporting off the data, then normalizing your data with dimensions is helpful for performance, flexibility, and maintenance. But a transactional table can still store references to dimensions to represent the "facts" / qualitative portion of the data to maintain normalization. Or they can even directly store the dimensions inside them themselves, albeit being a denormalized representation of the data from the former.

See the following for two different schemas representing a transactional table that stores dimensions vs being normalized and storing references to those dimensions (T-SQL syntax):

Denormalized

CREATE TABLE DenormalizedTransactions AS
(
    TransactionId BIGINT,
    ItemName VARCHAR(100),
    ItemType VARCHAR(25)
    Quantity INT
);

Normalized

CREATE TABLE NormalizedTransactions AS
(
    TransactionId BIGINT,
    ItemId INT,
    ItemTypeId INT
    Quantity INT
);

CREATE TABLE Items AS
(
    ItemId INT,
    ItemName VARCHAR(100),
    Description VARCHAR(1000)
);

CREATE TABLE ItemTypes AS
(
    ItemTypeId INT,
    ItemType VARCHAR(25)
);
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top