logoalt Hacker News

Exoristostoday at 7:57 AM3 repliesview on HN

Why is your database so different from your domain?


Replies

Kon5oletoday at 10:58 AM

>Why is your database so different from your domain?

Usually it's due to one of these:

- The domain deals with a lot of things that are not in the database.

- The domain is one of many and deals with just a fraction of what is in the database.

- The domain deals with things stored in several databases.

- The database was designed in the 90s and the domain is new.

- It's not my database so I can't change it.

(Even for greenfield systems I don't think it's generally desirable that the database matches the domain model.)

show 1 reply
Ntrailstoday at 9:37 AM

Most commonly ime the application domain may only be some small fraction of the database which is designed/optimised for a much broader dataset.

wuiheerfojtoday at 9:35 AM

I doubt domain logic would ever be in 2NF. My domain logic certainly doesn’t have pivot tables of IDs for join lookup