2

I have a web application that uses microservice architecture with a UI service decoupling front end from business services (like an API gateway). I'd like the UI to use fairly granular services so each control only needs to bind to data that's simple and relevant.

However in practice when the UI service needs to fulfill a request, it requests the relevant data from the microservices which don't necessarily have the same level of granularity. So each time a simple UI control updates, the underlying business services (and DAO's below that), are retrieving much more substantial data objects.

enter image description here

Is this a typical picture for microservices? Caching aside, I can't see how to avoid it without introducing a lot of finely granular methods into the microservice APIs (which feels like tightly coupling the business service interfaces to the UI). Alternatively would it be better to be less granular with the UI service, and allow the larger DTO up into the web page's Javascript?

Mush
  • 133
  • 1
  • 6
  • Microservices are often responsible for their data in the entire stack. Therefore, the UI widgets could be owned by the microservices as well. The UI would then be composed of these various components and would serve as a mediator between them. You would ditch the UI Service layer in that case and make sure the microservice has a supporting API for it's own widgets. – plalx Nov 22 '16 at 18:29
  • 2
    Your example also suggests that you are treating every single piece of data independently. That's overly segregating. You should have highly cohesive components which forms conceptual wholes. – plalx Nov 22 '16 at 18:41
  • 1
    Checkout [Stefan Tilkov's talk: "Wait, what!? Our microservices have actual human users?"](https://www.youtube.com/watch?v=G0_4u6TeREo&feature=youtu.be&utm_campaign=Meetups&utm_content=35335915&utm_medium=social&utm_source=twitter) – Sean Farmar Nov 23 '16 at 15:53
  • @SeanFarmar thanks, that's a great talk. He gave me a partial answer in the first five minutes pointing out latency between browser & UI service being slow vs latency between UI service and microservices. So I'm doing the right thing in segregating at the front end without worrying about the chat between microservices, but I still have the problem as we get closer to the database end of things - that will be the weight around this thing's neck... – Mush Nov 25 '16 at 14:17

0 Answers0