This is more about architecture question.

I will be developing microservice in Lumen or Slim, it will not be accessible from the public. The private microservice will be dealing private stuff. Laravel backend will communicate with microservice via REST API (Private / Internal use only). Users will know nothing about microservice.

If Frontend website (public) ever get hacked, it will minimise damage from accessing private stuff on the microservice.

However I want users to use Public API to communicate from public Frontend which then execute requests to microservice. To me this seem to duplicated API Requests - One for Public, and other one for Private (Backend to Microservice)? Or is it nothing wrong with that design?

enter image description here


This is a pretty solid design.

This way you will have the ability to change or replace your micro-service for something else while the public api will stay the same.

  • 1
    hmm theres one too many components talking directly to that DB for me
    – Ewan
    Apr 2 '17 at 6:56

This makes sense if the private API needs to do some things that the public API won't be expected to - such as if you need an admin system of some form, or reporting...

Having the public API call the private ensures most business logic is just in the private API, and not duplicated to other public APIs or sites.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.