Sunday 15 July 2018

What is the standard way to store runtime settings?

I currently develop an app that consists of 3 separate packages for now and they all share the same database (it's MySQL).Now I want to give user an ability to toggle some features on/off using some interface (I believe it doesn't matter, it could be web page with form, REST endpoint, etc) so my app should be able to save this setting somewhere and retrieve it when needed.What is the best way to do this?The most obvious way for me was using of JSON file but I don't think that it's a right way because my app may have hundreds of settings and I think that I should use database for this because it's application data after all.I came with idea to use settings table where I have text key and JSON value. JSON because MySQL supports it natively and settings may have different type of values. Then I can have some wrapper class that will fetch all settings from database and reload them when something changes (so I don't have to do DB requests when I need to check some setting).Is it OK?

Submitted July 15, 2018 at 11:03PM by Max_Stern

No comments:

Post a Comment