When we design the whole system we have few architecture pattern to select from. One of them is the layered architecture pattern, This pattern seems to be generic enough to fit in all other architecture patterns but with different scale.
For example if we choose Microservice architecture, each service still need it is own layers. Service either in SOA or Microservice need a persistence, service and application layer.
Sometimes the service is too small like createThumpImageService, which will only take image and to create thump of it then store the new thump in blob storage. If Such service with 10 lines of code layered, I think it will be over engineered.
My question is when layered architecture fit in ( component , subsystem , service , microservice) and when not?
If there some cases that layered architecture not the best choice, what alternative solutions that give us the decoupling and abstraction of layered architecture?