I have a Website which has a BFF (back end for front end).
It consumes data from a service (a CMS) and its own configuration data.
The CMS data and the apps config data are in separate schemas (so could be in different physical databases)
I need the BFF to decorate config data with cms data
So the options are:
- Querying the database joining the schemas. This clearly adds coupling at the db.
- We could replicate the data.
- Get the data from the CMS api and aggregate in the BFF.
My preference is 3. However when arguing the case other engineers believe 1 and 3 to be just as coupled - the coupling is just moved.
My opinion is coupling at an API is looser than at a db. Also, the more things talking to the db the less easy it is to change the db schema for the CMS project.
Thoughts?