1

I will keep this short, I am looking to store product plan data, these are the plans that the users would pick for their payment options. This data include how much the plan cost and what the unit details of the plan are, like what makes a unit (day/week/month) and fairly simple data about the plan. These plans may or may not change once a month or once a year, the company is a start up and things are always changing on the 11th hour and contently so there is no real way to predict when they will change. A co-worker and I are discussing whether these values should be stored in the web.config (where they currently are) or move them to the database.

I have done some googling and I have not found any good resource that help draw a clear line of when something should be in the database or in the web config. I wanted to know what your thought on this was and see if someone could clearly define when data should be stored in config or in the database.

Thanks for the help!

4

1 回答 1

0

从您提供的简要描述来看,在我看来,配置数据最终不仅可以由运行在一台计算机上的基于 Web 服务器的应用程序访问,还可以由其他支持应用程序访问,例如月末批处理作业,您可能希望在其他计算机上运行。为了支持这种可能性,最好将数据存储在某种可以从多台计算机远程访问的集中式存储库中。

将配置数据存储在数据库中是满足该要求的明显方法。但是,如果您不想这样做,那么另一种方法是将配置数据存储在公司内部(而不是公共)Web/ftp 服务器上的文件中。然后,应用程序可以使用curl等实用程序从 web/ftp 服务器检索配置文件。

在这两种方法中,我认为使用数据库可能是最好的,因为它提供了一种符合人体工程学的方法,不仅可以读取配置数据,还可以更新它。

于 2013-08-24T07:42:24.230 回答