From monoliths to microservices
Microservices apply the UNIX philosophy (“Do one thing and do it well”) and the Single-Responsibility Principle (SRP)—where each module is responsible to one, and only one, actor (a group of stakeholders or users)—to full applications. Rather than compiling every feature into one binary or VM, a microservices architecture structures an application as a collection of loosely coupled, independently deployable services, each handling one business task and usually managing its own database.
Historical context from the source: Amazon’s 1998 Distributed Computing Manifesto outlined encapsulating data inside services with event-driven workflows (an early form of Service-Oriented Architecture, SOA); the term microservices appeared at a workshop near Venice in May 2011 and was popularized by Lewis and Fowler in 2014.
Concrete example: Online Boutique and selective scaling
Google Cloud’s Online Boutique (microservices-demo) demonstrates how one storefront splits into separate services, each typically running in its own container:
- External requests enter over HTTP (
InternetorLoad Generator->Frontend). Frontenddelegates to specialized backend services:ProductCatalogService,RecommendationService,CartService(backed by a Redis cache),AdService,CurrencyService,ShippingService, andCheckoutService.CheckoutServicein turn coordinatesPaymentService,ShippingService,EmailService,CurrencyService,ProductCatalogService, andCartService.
This separation changes how scaling works (Martin Fowler’s comparison): a monolith replicates the entire application block onto every server, whereas microservices distribute individual services across servers and replicate only the heavily loaded ones (for example, several replicas of ProductCatalogService alongside one instance of EmailService).
Monolithic vs. microservices architecture
| Characteristic | Microservices architecture | Monolithic architecture |
|---|---|---|
| Unit design | Loosely coupled services; each supports one business task | Single unit designed, developed, and deployed together |
| Functionality reuse | Public or internal APIs expose capabilities to any client or app | Limited reuse across separate applications |
| Internal communication | Network-based: request-response (REST/HTTP, gRPC) or async pub/sub (Kafka) | In-process procedure/function calls with no network limit |
| Tech flexibility | Each service can choose the best language and framework for its task | Usually written in one language and framework |
| Data management | Decentralized: each service may own its database | Centralized: shared database(s) for the whole application |
| Deployment | Independent deployment per service | Any small change requires redeploying and restarting the whole app |
| Maintainability | Focused, smaller services simplify local maintenance | Complexity grows as overall scope expands |
| Resiliency | Distributed; remaining replicas keep serving if one instance fails | Failure in one component can bring down the entire application |
| Scalability | Scale each service independently | Must scale the entire application together |
Embedded libraries vs. microservices
Both libraries and microservices enable code reuse, so learners frequently confuse when each applies:
| Property | Embedded library (traditional) | Microservice (modern) |
|---|---|---|
| Nature of component | Code only (e.g., logging, JSON marshalling/unmarshalling, auth library) | Live running component: code + data |
| Data ownership | Every calling app embeds the code and maintains its own database (e.g., separate Users DBs and password-reset flows) | One shared service holds both the logic and the single authoritative Users DB |
| Integration | Linked into the app; called via local functions | Invoked over the network through an API |
| Updating | Must recompile and redeploy every application that embeds the library | Update the microservice without recompiling callers, provided the API contract stays compatible |
Because projects can compose already-running services (such as a company-wide authentication service), delivery times shrink dramatically.
Discovery problem: knowing which services exist
Unlike top-down, architect-designed SOA, microservices are developer-driven and evolutionary (“clone and evolve, the best will survive”). When an application relies on hundreds of services and an overall “architecture blueprint” no longer exists, meetings, calls, and emails cannot keep teams informed about who owns each service, what data it holds, or what API it exposes.
Organizations solve this with a software catalog / developer portal—such as Backstage (created at Spotify and donated to the CNCF)—so services are self-documented and discoverable without human coordination.
Common confusions
- Modular code in one deployable is not microservices: Dividing code into clean packages inside one shared runtime still yields a monolith unless services run and deploy independently.
- Libraries do not eliminate data duplication: Sharing an authentication library still forces every application to store and manage its own copy of user credentials.
Retrieval
- Two applications, A and B, both need user login. Compare importing an
authlibrary versus calling anAuthenticationmicroservice when user passwords change or a bug fix is released.
With an embedded library, A and B each keep separate user databases (requiring separate updates/resets) and both must be recompiled to adopt a library patch. With a microservice, both share one live service + Users DB over an API, and the service can be patched without recompiling A or B as long as the API remains compatible. - Why does a large microservice organization need a software catalog like Backstage even if every service has a clean API?
Because developer-driven architectures evolve without a central blueprint, teams cannot rely on human meetings to track hundreds of services; a catalog documents ownership, purpose, data, and APIs for self-service reuse.
Source: Lecture 10 - Microservices and Containers Orchestration, PDF pages 6–15.