fadedbee
fadedbee

Reputation: 44797

Mixing configuration and reporting fields in one table

I have a gut reaction that says mixing configuration and reporting fields in one table is a bad idea.

A simple example would be a users table with a name field and a last_logged_in field.

What are the issues with mixing admin-updated-configuration with production-updated-meta-data?

Or is my gut reaction unfounded?

Upvotes: 2

Views: 15

Answers (1)

Chris Travers
Chris Travers

Reputation: 26464

It is not a bad idea necessarily. However there are some corner cases where it might be.

In general when we do database design we don't look at how information is used, only how it relates to other data. In general this sort of data doesn't break this rule. There are however cases where it might.

For example, many database problems can be solved if a data set can be made append only. This then poses a problem since each login forces you to update the users table. If you log logins in a separate append-only table that problem goes away (if you don't have to use append-only patterns here, that may not matter).

Additionally it can make permissions more complex to manage.

But these are usually insignificant, and usually fall into the category of premature optimizations.

Upvotes: 1

Related Questions