We started a project recently, and during the design process, we have some arguments among team members. We have to deal with enumerations so we ended up with three choices.
- Have the enumerations as Normal Enums in Database
- Have the enumerations inside the Application and isolated from the Database. Keep them only in App level.
- Store the enumerations in different tables in the DB
What do you think and why?
From my experience, I choose the 3rd, as I 've never seen that the cost of joins is really an issue. And if you use an ORM then the cost of joins is almost nothing due to caching.
Best Answer
There is a dichotomy between two opposing viewpoints
Is there any business logic based on the set within the compiled application. e.g.
This favours an enum within the application.
You have to decide which is most important to your case. Having both a lookup table and an enum, might seem like belt and braces security, but can soon cause issues if they get out of step.