Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7535905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:25:39+00:00 2026-05-30T06:25:39+00:00

I have some global settings For example some below are ShortLeaveAllowedInOneDay = 2 LeaveAllowedInMonth

  • 0

I have some global settings
For example some below are

ShortLeaveAllowedInOneDay = 2
LeaveAllowedInMonth = 3

I have following options to store these global settings

1-Store in Database table
2-Store in Webconfig file
3-Store in class as const filed

4-In XML file

Could you please suggest me which one is better approach and why

I am using Asp.net MVC3
with sqlserver 2005

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T06:25:41+00:00Added an answer on May 30, 2026 at 6:25 am

    It depends on your requirements, each one of these options has it own advantages and disadvantages. It tried to list a few:

    1. Store in Database table
    Advantages:

    • Relatively easy to read settings.
    • Possible to write/update settings.
    • Access is to the database is fast.
    • Updates to database values are immediately available.
    • DB is can be shared across multiple instances in clustered environment.

    Disadvantages:

    • More infrastructure required than the rest of the options (i.e. tables, db access etc).
    • If done incorrectly DB IO can become an issue. (Can be solved with caching strategies)

    2. Store in web.config file
    Advantages:

    • Simple to add and access settings.

    Disadvantages:

    • Changes to the web.config may result in the application pool to restart.
    • Settings are generally not encrypted.
    • In a clustered environment the file has to be kept in sync with other instances.
    • Generally have to deal with strings data types and possible invalid user input when settings are set.

    3. Store in class as const field
    Advantages:

    • Very simple to work with.
    • Can work with static types.
    • Good first step towards refactoring settings into one of the other options.

    Disadvantages:

    • Requires rebuild for settings to change.

    4. In XML file
    Advantages:

    • Convenient for storing complex settings such a hierarchies.
    • Custom XML config settings can be embedded inside the web.config. (Popular option see log4net as one such example)
    • Updates to the config files can be made without restarting the application pool.
    • An XSD can enforce the validity of the settings in the file (both structure and data types)

    Disadvantages:

    • It is XML. Not really human readable, formats like YAML improves on that.
    • Implementation required to parse XML for reading and writing settings.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I usually have a config-file with some global variables for database connectivity settings (such
I usually have a config-file with some global variables for database connectivity settings (such
I have some global settings variables I need to store for my application, but
I have some settings in my app.config which I intend to be 'global' -
I have a string like following: CREATE GLOBAL TEMPORARY TABLE some_temp_table_name or CREATE GLOBAL
I have set up some custom symfony project-level settings in the file config/project.yml following
I have some global settings in my application that is going to be handled
I have some global variables in a Python script. Some functions in that script
Hey right now I'm using jQuery and I have some global variables to hold
I've never used the Global Temporary Tables however I have some questions how they

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.