title: Architecture of a microservice based web app
body: <p>I am confused about the point at which a web application diverges into microservices - is it at url level or models level?
  As an example, Suppose I have a monolithic app that serves 3 pages. Say each page serves a separate usecase and I want to back each of them with their own microservices. Now, which of these is the correct way of implementing a microservice based architecture:</p>
  
  <ul>
  <li>I create three different apps(microservices), each containing the (route, controller, models, templates) for one of the pages. And then based on which ever page is requested, I route the request to that particular app. This means that the whole page from database to HTML is served by a separate app. Basically, different pages in the same website are being completely served by different apps on the backend.</li>
  <li>The 3 microservices do not handle the UI stuff but only the data for their usecases(models, controller, no templates) and expose it over a REST api. I have one public facing app. This app queries the three different apps(microservices) only for the data and then builds the html pages to be returned to browser. All the pages in a web app in this case are being served by a single app which internally makes use of three different microservices.</li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/b62O1.png" alt="enter image description here"></p>