vendredi 19 juillet 2019

Recommended API Design for external services

I've been asked to rewrite an API to a new language (Node) for a number of reasons, the most significant being an effort to unify the technology stack into the fewest amount possible of languages (JS in this case).

The current API design is pretty simple: We have controllers for each endpoint being called. Controllers call a corresponding "Query" (Located inside a model) and these models call "Services (All the external APIs).

|Controller| <===> |Model/Query| <===> |Service 1 (Headless CMS)|
                                 <===> |Service 2|
                                 <===> |Service 3|

Each model forms a structure that is later returned to the controller and later returned as a JSON File.

My question is: How can I design this to be a bit more scalable? Our main issue is that the results of the headless CMS are sometimes tightly couples with other services, in the sense that the headless CMS returns some placeholder text that needs to be overridden by the content of other services.

Or this simple model should be the way to go?

Let me know your thoughts!

Aucun commentaire:

Enregistrer un commentaire