soa vs monolith vs microservices vs serverless

SOA focuses on application service reusability, while Microservices focus more on decoupling.

SOA is monolithic in nature, whereas Microservices is full-stack.

SOA applications are built to perform numerous business tasks, but microservices are built to perform a single business task.

SOA involves sharing data storage between services, while in Microservices, each service can have independent data storage.

SOA is designed to share resources across services, while Microservices is designed to host services that can function independently.

In SOA Architecture, DevOps and Continuous Delivery are becoming popular but yet not become mainstream, while Microservices have a strong emphasis on DevOps and Continuous Delivery.

SOA is a less scalable architecture, while Microservices is a highly scalable architecture.

 



 

Never expose db entities directly to api. what is the risk ?
Exposing DB entities directly through APIs creates tight coupling between persistence and API contracts, increases security risks, leaks sensitive/internal fields,

causes lazy loading and serialization issues, makes versioning difficult, and violates clean architecture principles.

DTOs should be used to isolate external contracts from internal persistence models.