How do you handle application settings?

I’m trying to figure out the best way to structure the settings for various features in an app. Right now for each feature I have a separate table that stores the settings for it as JSON, and then on account creation I use Ecto.Multi to insert the default values for all the settings.

This system doesn’t seem like something that would be sustainable in the long run. My other idea for solving it would be to store all the application settings as JSON in a column on the user table, and then just use different changesets depending on what form is being used. So if they are updating “Media Settings” it will use the media settings changeset and only validate and update those pieces of the JSON, etc.

Is this a viable option for handling the settings? Is there a better way?

schema/2 in Ecto allows you to set default values for each field of your schema. For example: field :status, :string, default: :inactive