Constants vs Database

Certified Lead Developer

Hi all,

I am developing an application that contains a questionnaire with around 20 questions. There are also around 10 sections to display help. 

Both questions and help can be updated by the users. 

I dont know if I should create 30 constants or store the data in the DB.

For performance reasons I think is better to use constants but for memory management and scalability I think the DB makes more sense.

Is there any recommendation about this?

  Discussion posts and replies are publicly visible

Parents
  • Hi Jesus

    DB is definitely the way to go. If designed correctly it'll allow you to be able to maintain the questions in your Production environment without ever having to do a code change/deployment. Not only could you change the existing questions you could add new ones or deprecate old ones and STILL not have to make any code changes. In this way you would future-proof your solution.

Reply
  • Hi Jesus

    DB is definitely the way to go. If designed correctly it'll allow you to be able to maintain the questions in your Production environment without ever having to do a code change/deployment. Not only could you change the existing questions you could add new ones or deprecate old ones and STILL not have to make any code changes. In this way you would future-proof your solution.

Children
No Data