System analysis is the process of gathering and understanding requirements before building a system. It helps in breaking down the system into smaller components for better clarity and efficiency.
- Identifies problems early and ensures correct requirements are captured.
- Improves system structure by defining how components interact.
System design is the process of creating the architecture and components based on analyzed requirements. It includes planning, designing, deploying, and testing phases to build an effective system.
- Translates requirements into a structured system architecture.
- Ensures the system functions efficiently in real-world scenarios.
Types of Systems in System Analysis and Design
Now that we understand system analysis and how it differs from system design, it is important to explore the major types of systems used in system design. These systems define how applications are structured and deployed in real-world scenarios.
Generally, systems can be categorized into two main types:
- Monolithic Systems
- Distributed Systems (often implemented using microservices architecture)
Monolithic Systems
A monolithic application is a software system where all functionalities exist within a single codebase. It is built as one large, unified block, with tightly integrated components that are developed and deployed together.
- Single Deployment: All features are packaged and deployed as one unit.
- Tightly Coupled Components: Changes in one part can affect the entire system.
Monolithic Architecture
The Monolithic system architecture can be visualized by considering three sections or three layers:
- Client Tier or User Layer or Presentation Layer: It is the closest layer to the user and hence it can be either a webpage or a web application where the user gets things done. It takes input lead from the user, interacts with the server, and displays the user result. Hence we call it a front-end layer.
- Middle Tier or Service Layer: It compromises all the logic behind the application and is there in the application server. The application server includes the business logic, receives requests from the client, acts on them, and correspondingly stores the data.
- Data Tier or Persistence Layer: It includes a data persistence mechanism(DB) and communication with other applications. It includes databases, message queues, etc. Database server will be used by application server for the persistence of data.

Advantages
Monolithic architecture is simple to build and manage, making it suitable for small to medium-sized applications.
- Easy development: It follows a traditional approach and is easier to develop initially since all components are part of a single codebase.
- Easy deployment: All components exist in one repository, so the entire application can be deployed as a single unit.
- Easy testing: Due to tight integration, end-to-end testing is straightforward and easier to perform using testing tools.
Tip: Monolithic architecture is commonly used by organizations in the early stages because it has fewer cross-cutting concerns such as caching, logging, and handling. Since everything is managed in a single system, it becomes easier to develop, debug, and maintain initially.
Disadvantages
Monolithic architecture can become difficult to manage and scale as the application grows in size and complexity.
- The codebase is stored in a single repository, which can make it difficult to understand and maintain over time.
- Any changes in the codebase require complete redeployment of the entire application.
- Less reusable, as components are tightly coupled within the system.
- Less scalable because different components may have different scalability requirements, but must be scaled together.
Microservices
Microservices is an architectural style in which an application is built as a collection of small, independent services. Each service handles a specific functionality and communicates with other services using lightweight protocols such as HTTP.
Microservices Architecture
The Microservice architecture has a significant impact on the relationship between the application and the database.
- Instead of sharing a single database with other microservices, each microservice has its own database.
- It often results in duplication of some data, but having a database per microservice is essential if you want to benefit from this architecture, as it ensures loose coupling.
- Another advantage of having a separate database per microservice is that each microservice can use the type of database best suited for its needs.
- Each service offers a secure module boundary so that different services can be written in different programming languages.
- There are many patterns involved in microservice architecture like service discovery & registry, caching, API gateway & communication, observability, security, etc.

Advantages
Microservices architecture improves scalability, flexibility, and system resilience by dividing the application into independent services.
- Scalability: Each service can scale independently, helping optimize resource utilization and reduce infrastructure costs.
- Flexibility: Services can be developed, deployed, and updated independently, allowing teams to work on different parts simultaneously.
- Resilience: Failure of one service does not impact others, making the overall system more reliable.
- Technology Heterogeneity: Different services can use different technologies and programming languages, as long as they can communicate effectively.
- Easy maintenance: Since services are independent, updates and maintenance can be performed without affecting the entire system.
Disadvantages
Despite its benefits, microservices architecture introduces complexity and operational challenges.
- Complexity: Managing a large number of small services increases development, deployment, and maintenance complexity.
- Increased overhead: More network communication and data consistency handling are required between services.
- Testing complexity: Ensuring all independent services work together correctly makes testing more difficult.
- Distributed systems: Being a distributed system introduces challenges in monitoring, debugging, and management.
- Skillset: Requires specialized skills and experience compared to traditional monolithic development.
Monolithic Vs Microservices architecture
This comparison highlights the key differences between monolithic and microservices architectures in terms of structure, scalability, deployment, and maintainability.

| Monolithic Architecture | Microservice Architecture |
|---|---|
| Single-tier architecture | Multi-tier architecture |
| Built as one large application with tightly coupled components | Composed of small, loosely coupled services components |
| Deployed as a single unit | Individual services can be deployed independently |
| Horizontal scaling can be challenging | Easier to scale horizontally |
| Development is simpler initially | Development is more complex due to multiple services |
| Technology stack choices are usually limited | Freedom to choose the best technology for each service |
| Entire application may fail if a part fails | Individual services can fail without affecting others |
| Easier to maintain due to its simplicity | Requires more effort to manage multiple services |
| Less flexible as all components are tightly coupled | More flexible as components can be developed, deployed, and scaled independently |
| Communication between components is faster | Communication may be slower due to network calls |
Distributed Systems Vs Microservices
When adopting a Microservices architecture or migrating from a Monolithic architecture, it’s not feasible to handle all components on a single system—doing so would contradict the modular nature of Microservices. This is precisely where Distributed Systems come into play.
Distributed Systems not only bring modularity to your architecture but also provide a foundation that makes implementing Microservices more efficient and effective. They enable seamless scaling, independent service deployment, and better resource utilization, allowing you to fully leverage the benefits of a Microservices approach.
Distributed Systems
A Distributed System is a collection of multiple independent systems connected through a network, working together by sharing resources to achieve common objectives. In real-world applications, distributed systems are increasingly preferred because they offer significant advantages over monolithic architectures. They are highly scalable, and by distributing resources across multiple systems, they effectively eliminate the Single Point of Failure (SPOF) issue, enhancing overall reliability and fault tolerance.

As seen above media, in a distributive system, nodes are geographically distributed. So what if a node crashes due to power failure? In Distributed systems, the data will not be lost as data has been shared across multiple servers. Hence redundancy/replication helps us in saving data which is very essential as a backup is already there to take over justifying SPOF.
Example: Telecommunication Networks

Advantages
Distributed systems provide high scalability, reliability, and improved performance by using multiple interconnected machines.
- Scalable: Since it consists of independent machines, horizontal scaling can be easily achieved.
- Reliable: Eliminates Single Point of Failure (SPOF); even if one node fails, others continue to operate.
- Low latency: Multiple geographically distributed servers help serve users faster by reducing response time.
Disadvantages
Despite their benefits, distributed systems introduce complexity in management, communication, and data consistency.
- Complexity: A large number of nodes and network connections make the system difficult to design and maintain.
- Consistency: Maintaining synchronized data across multiple nodes becomes challenging.
- Network Failure: Communication depends on network calls, so failures can lead to delays, data conflicts, or system issues.
Note: Management is also a disadvantage here out because of load balancing functionality(It is a process of distributing the load to the nodes), logging, caching and monitoing is required to manage the systemto prevent failures.
Race Conditions in Monolithic and Distributed Systems
A race condition occurs when multiple processes or services execute concurrently and the final outcome depends on the timing or order of execution. It typically arises in systems with parallelism where shared resources are accessed without proper synchronization.
Race conditions are commonly seen in operating systems and also occur in scalable systems where multiple requests are processed at the same time, leading to conflicts or inconsistent results.
Example: Consider a banking system where multiple microservices handle operations like credit card approval. Suppose a service checks a user’s CIBIL score before approving a credit card.
Now, if multiple requests for the same user are processed simultaneously, two services might read outdated data and both approve or reject incorrectly. This overlapping of operations leads to a race condition.
Note: Race conditions are very common in distributed systems because multiple services and nodes process requests concurrently. Due to this parallelism, operations may interleave in unpredictable ways, leading to inconsistent or incorrect results if not handled properly.
Handling Race Conditions in Distributed Systems
Proper handling of race conditions is essential to ensure data consistency and system correctness.
- Atomic Operations: Combine the validation check and update operation into a single atomic step (e.g., database transactions).
- Service Refactoring: Move validation logic into a centralized or dedicated service (e.g., customer validation service) to ensure consistent decision-making.
- Additional Approaches (Recommended): These techniques help prevent race conditions and ensure consistency in distributed systems.
- Use locking mechanisms (optimistic or pessimistic locking) and implement idempotency to avoid duplicate operations.
- Apply distributed transactions or use event-driven patterns to manage consistency across services.

