I have some data (list of parameters) that should be shared across the backend and the frontend. The changes are really infrequent, and changes usually mean a redeploy. Currently, it is stored in the DB, some tables have foreign keys on it. By extending the functionality we had to keep adding new and new properties on these objects, to be able to filter on a certain set of them. Since these properties are often overlapping, it is a huge mess now. Recently I had the idea of storing these params in a language independent descriptor file (JSON/toml/yaml) in a separate repository, and distribute a js module for the frontend and a python module for the backend from this configuration. The parameters can be added to lists, so the problem of the overlapping properties would be solved, I could just add them to lists in the descriptor file. The foreign key is not really a big deal, the DB querying can be done with a text/enum field. The only thing is that the related entries won't be removed, a custom migration needed.
Benefits: - Fewer requests from the client - I think it'd be easier to store and group them
Drawbacks: - Perhaps it'd be a bit harder to understand how this thing works and what changes have to be made to extend this functionality.
Since things go in the other direction usually (people move stuff to the DB instead of removing from there), I'd like to ask if anyone did something similar and if it is a good idea or not?
I think it is irrelevant, but the frontend is written in Angular 1.x and the backend is Django + Python.