Search code examples
microservicesmulesoft

System API in mulesoft


I have a requirement to persist some data in a table (single table). The data is coming from UI. Do i need to write just the system API and persist the data OR i need to write process and system API both? I don't see a use of process API in this case. Please suggest. Is it always necessary to access system API through process API or system API can be invoked without process API as well.


Solution

  • I would recommend a fine-grained approach to this. We should be following it through the experience layer even though we do not have must customization to the data. In short, an experience layer API and directly calling System layer API (if there is no orchestration/data conversion/formatting needed)

    Why we need a system API & experience API? A couple of points.

    • System API should be more attached to the underlying system. And if in case, in the future, it changes then it should not impact any of the clients.

    • Secondly, giving an upper layer gives us the feasibility to add different SLAs, policies, logging and lots more, to different clients. Even if you have a single client right now it's better to architect for the future. Reusing is the key advantage of these APIs.

      Please check Pattern 2 in this document