9 votes

Are surrogate keys a known anti-pattern?

First of all, whoever came up with this idea seems to misunderstood what a surrogate key is. A surrogate key is a form of primary key. There are two competing ideas among database administrators about ...
user avatar
  • 22.8k
3 votes

Metadata persisted or created at runtime?

Most modern databases will allow you to have your cake and eat it too. You can, in the databases, code up business logic like this as a virtual column. This will let you have a column that is ...
user avatar
  • 338
2 votes
Accepted

Mixing static referred and dynamic data in database

Putting limits on values for database identifiers can be problematic. Today, you think "surely 1000 static items will always be enough." But what happens when it isn't enough? Values 1-1000 ...
user avatar
2 votes

Metadata persisted or created at runtime?

This doesn't sound like metadata but business rules (pretty inflexible in this example). Business rules should normally be evaluated when you need their results, although it sometimes makes sense to ...
user avatar
1 vote

Metadata persisted or created at runtime?

In my experience (and I like a lot to calculate these things on the fly) the answer to the question is driven by questions like How often do I need to query (the database) by toBeSold? In how many ...
user avatar
  • 11.7k
1 vote

Metadata persisted or created at runtime?

Store the metadata on the database. You will want to use the database for filtering and reporting. ie "how many houses are in status "ToBeSold"?" You cant loop through them all ...
user avatar
  • 64.6k
1 vote

Form builder app database design adding versioning

There are a variety of options with associated trade offs: Create a new explicit version of the form for each change - and snapshot each element of the form for each change. Lots of records, but ...
user avatar
  • 338

Only top scored, non community-wiki answers of a minimum length are eligible