
Discover more from Tech World With Milan Newsletter
What is Microservice Architecture?
and how to properly do it with Self-contained Systems (SCS).
Microservice architecture has revolutionized how companies build and scale software. Giants like Netflix and Amazon leverage it to deliver new features rapidly and efficiently. But what exactly is microservice architecture, and why does it matter?
This post breaks down the core concepts, benefits, and trade-offs of microservices and explains how they compare to an alternative approach: Self-Contained Systems (SCS). Whether exploring microservices for the first time or considering a shift to SCS, this guide will help you navigate the key architectural choices and patterns that define modern software development.
So, let’s dive in.
What is Microservice Architecture?
Have you ever wondered why companies like Netflix and Amazon seem to roll out features at the speed of light? The secret might be hidden in their tech stack based on Microservice architecture.
At its core, Microservice architecture is about breaking down an application into a collection of small, loosely coupled services. Each service runs a unique process and communicates through a well-defined API. Each service is a separate codebase, which can be managed by a small development team and deployed independently.
Sam Newman defined Microservices in his book "Building Microservices" as:
Microservices are small, autonomous services that work together.
Microservices architecture is the best fit when we have applications with high scalability needs, many subdomains, and possibly multiple cross-functional development teams. Take into account that organizational shape influences your architecture.
Critical Elements of Microservice Architecture:
Load Balancer: Ensures even distribution of incoming network traffic across various servers.
CDN (Content Delivery Network): A distributed server system that delivers web content based on the user's location. It's about bringing content closer to the end-user, making page loads faster.
API Gateway: This is a single entry point for all clients. It directs requests to the appropriate microservice using REST API or other protocols.
Management: Monitoring and coordinating the microservices, ensuring they run efficiently and communicate effectively.
Microservices: Each microservice handles a distinct functionality, allowing for focused development and easier troubleshooting. They can talk with each other using RPC (Remote Procedure Call). Services are responsible for persisting their own data or external state.
When building such architectures, we should strive for every service to have a single responsibility with clear boundaries. The services should communicate asynchronously, have a separate database, and build+deployment per microservice.
Benefits of Microservice Architecture
Scalability: Scale up specific parts of an app without affecting others.
Flexibility: Each microservice can be developed, deployed, and scaled independently.
Resilience: If one microservice fails, it doesn't affect the entire system.
Faster Deployments: Smaller codebases mean quicker feature rollouts.
Drawbacks of Microservice Architecture
Complexity: More services can lead to a more complex system.
Eventual Consistency: Maintaining consistency across services can be challenging.
Network Latency: Inter-service communication can introduce delays.
Error handling: When an error happens, it's hard to debug why and where it happened.
Wrong decomposition: If you do a bad decomposition of your monolith, you can develop a Distributed Monolith.
If you want to learn more about microservices, check out the book “Building Microservices” by Sam Newman:
And the free book for .NET Microservice Architectures by Cesar de la Torre, Bill Wagner, and Mike Rousos:

Also, to handle different trade-offs when creating microservice architecture, we need to know patterns such as Circuit Breaker, Saga, etc. Check Design patterns for Microservices and monolith decomposition strategies.
What are Self-contained Systems (SCS)?
Self-contained Systems (SCS) are a software architecture approach that prioritizes the decentralization of applications into independent systems, each with its domain logic, UI, and data storage. Unlike Microservices, smaller services focused solely on business logic, SCS are larger and encompass a broader scope within a specific domain.
SCS are systems that represent autonomous web applications. They include web UI, business logic, and database and might have a service API. A single team usually owns them.
The main advantages of such systems are:
Autonomy: Each SCS operates independently with its database, business logic, and user interface.
Domain-aligned: SCS is structured around specific business domains, ensuring each unit represents a coherent and meaningful set of functionalities.
Decentralized Data Management: Individual databases per SCS ensure data consistency within its boundary, reducing cross-service dependencies.
Technology Diversity: Allows for different technology stacks to be used across other SCS, suiting the specific needs of each domain.
Explicitly Published Interface: Well-defined interfaces for interactions with other systems, maintaining a clear contract while preserving encapsulation.
Independent Deployability: Each SCS can be deployed, scaled, and updated independently without affecting other systems.
Why Self-contained Systems (SCS) has the edge over microservices:
Broader scope: SCS has a broader scope encompassing the UI, business logic, and data storage within a bounded context
Reduced Operational Complexity: Microservices can lead to high operational complexity due to managing many smaller, interdependent services, while SCS is more significant and autonomous.
Data Consistency: SCS manages its data, which can improve data consistency within each system, while Microservices often rely on a shared data store.
Reduced Inter-service Communication: SCS, by encapsulating more functionality, requires less inter-service communication than microservices.
Better Fit for Certain Domain Complexities: Due to their domain-aligned nature, SCS might provide a better architectural fit in cases with high domain complexities and clear domain boundaries.
Such systems go well along with Domain-Driven Design (DDD). The first step in creating such systems is domain analysis, which can be conducted by identifying bounded contexts that align with specific business domains. Each bounded context is then encapsulated within an SCS, which comprises its own data management, business logic, and user interface, ensuring each system is autonomous yet able to interact with others through well-defined APIs when necessary.
If you want to learn more about Self-contained Systems, check these resources:
Self-contained Systems by INNOQ.
“Self-Contained Systems (SCS): Microservices Done Right,” InfoQ article.
“Our journey from Microservices towards Self Contained Systems,” Swissquote article.
Self-contained service at Microservices.io.
Free e-book: Designing Distributed Systems
Check out the free book by Brendan Burns, a creator of Kubernetes on Distributed Systems. In this book, you will learn about the following:
How patterns and reusable components enable the rapid development of reliable distributed systems.
Using the sidecar, adapter, and ambassador patterns, you can divide your application into a group of containers on one machine.
Explore loosely coupled multi-node distributed patterns for replication, scaling, and communication between the components.
Learn distributed systems patterns for large-scale batch data processing.
Download the book from here and the labs for the book.
🎁 Promote your business to 350K+ tech professionals
Get your product in front of more than 350,000+ tech professionals who make or influence significant tech decisions. Our readership includes senior engineers and leaders who care about practical tools and services.
Ad space often books up weeks ahead. If you want to secure a spot, contact me.
Let’s grow together!
More ways I can help you
📢 LinkedIn Content Creator Masterclass. In this masterclass, I share my strategies for growing your influence on LinkedIn in the Tech space. You'll learn how to define your target audience, master the LinkedIn algorithm, create impactful content using my writing system, and create a content strategy that drives impressive results.
📄 Resume Reality Check. I can now offer you a service where I’ll review your CV and LinkedIn profile, providing instant, honest feedback from a CTO’s perspective. You’ll discover what stands out, what needs improvement, and how recruiters and engineering managers view your resume at first glance.
💡 Join my Patreon community: This is your way of supporting me, saying “thanks," and getting more benefits. You will get exclusive benefits, including 📚 all of my books and templates on Design Patterns, Setting priorities, and more, worth $100, early access to my content, insider news, helpful resources and tools, priority support, and the possibility to influence my work.
🚀 1:1 Coaching: Book a working session with me. I offer 1:1 coaching for personal, organizational, and team growth topics. I help you become a high-performing leader and engineer.