In today's rapidly advancing world, it is imperative to embrace the latest technologies in order to craft systems that are scalable, reliable, maintainable, and portable. However, this approach often leads to reactive designs that are not adaptable to evolving needs. System design should be driven by requirements, not by technology. Achieving a successful system design calls for a profound understanding of both architecture and business requirements, ensuring that the resulting solution aligns seamlessly with the intended goals.
For instance, when designing a system to handle 10 million daily requests with 20 ms latency, it's tempting to opt forMicroservices architecture, database sharding, and highly distributed cloud infrastructure. While these choices may work, they often overlook the importance of employing architectural design principles.
A prime example of this system is "Stack Overflow," which is built on a monolithic architecture. Its success stems from a profound technical understanding and the utilization of software architecture principles.
The key point here is that fundamental design choices determine the system's trajectory.
Architects gravitate towards the latest technologies or attempt to implement a multitude of design principles to achieve scalability. Like patterns: DDD, EDA, Microservices, serverless, CQRS, layered architecture, and design principles: SOLID, Principle Of Least Astonishment, DRY, Explicit dependency, etc
While architects aspire to implement these principles, in reality, architects are often constrained by time, resources, and urgency, and the evolving business and technology landscape may not always provide an opportunity to rebuild and implement the best architecture choices.
This is why it is crucial to design systems based on fundamental design principles.
This article highlights the importance of one of the core architectural principles that establish the very foundation for achieving success and facilitate the implementation of other architectural principles.
The principle states that a system should be built on top of manageable components, with each component addressing a specific concern while minimizing overlap.
A successful SoC implementation requires clearly defined component responsibilities, clearly bounded contexts, well-defined interfaces, loose coupling, and high cohesion.
Enablers for SoC include SOLID Principles, Message Queues, Event Bridges, state management constraints, API gateway, and Streaming platforms.
SoC is THE most important architectural principle as it allows your architecture to evolve over time to support both technology and business vision.
Some major advantages of this architecture include:
Promotes Modularity
Reduce blast radius
Enable Faster time to market
Enhances Maintainability, Scalability, and durability
Improves Data Quality
Enable evolving architecture and modernization like Cloud Migration, Containerization, Event streaming, etc.
This principle is applicable to any system, whether it's legacy or modern: Monolith, Microservices, SOA, Enterprise IT, SaaS applications, traditional web applications, backend engines, or analytics platforms.
Consider SoC as the foundational design pattern for any system. A system lacking SoC will have poor extensibility and hinder future architectural evolution
The architecture of Twitter is built upon several components, each with clearly defined capabilities and boundaries. It serves as a good reference for large-scale systems built using the principle of Separation of Concerns, coupled with high-performance infrastructure to support high throughput, availability, and low latency, as demonstrated by their "Manhattan" infrastructure.
Some major components and Services include:
Timeline Mixer
Ad Mixer
Onboarding Service
People discovery
Prediction service
Recommendation and Analytics Engine
Search Service
Indexing and MapReduce
And some technology choice that enables scalability
For deep dive into Twitter’s infrastructure please refer to:
Let’s understand how Twitter might have delivered this service faster using the SoC architecture principle.
The requirement has the following broad features
Capability: Offer Monetization for content creators
Features:
High-Level architecture: The architecture below demonstrates how these components are orchestrated to build the desired capability.
Build & Development
How did this architecture benefit Twitter?
Time to Value
Build components independently without impacting existing stack
Separate teams can build/test each components for faster build
New component can be build on pilot infrastructure and scaled independently based on adoption
Reduce blast radius
By separating concerns into distinct modules or components, failures or errors within one module are contained and do not affect other modules.
Isolation limits the blast radius and prevents widespread system failures.
Enable evolvability
In conclusion, this article emphasizes the significance of building software systems based on fundamental design principles, with Separation of Concerns being the most critical principle. The example of Twitter showcases how applying this principle contributes to successful system design, enabling scalability, maintainability, and adaptability to evolving business and technological landscapes.
What's not covered in the article?
Please feel free to reach out if you have any questions!