2 ms·
AKA the BLL or Business Logic Layer? I guess the only reason you would re-write business logic in the presentation layer is because you can't afford the extra r
by zaroth 11y ago
AKA the BLL or Business Logic Layer? I guess the only reason you would re-write business logic in the presentation layer is because you can't afford the extra round-trips, and it's cheaper than writing an aggregation layer on your backend.
But generally wouldn't you just add the APIs into the core microservice to return the requested dataset (at the various necessary "levels" of cardinality) for the various different consumers? Keeps everything in one place.
Then you use nginx lua script to allow a single HTTP request from the client to be dispatched to the various microservices and packaged together in the reply in a singel round-trip. This can be just a few lines of code serving any combination of possible sub-requests. I don't like the idea at all of building another service layer on the backend to do the aggregation and expose a different API... I think you can do something similar in the development branch of HAProxy.