0% found this document useful (0 votes)
10 views7 pages

Monolithic vs Microservices: Key Concepts

Simple System Design and Software Engineering Notes

Uploaded by

Arijit Roy
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views7 pages

Monolithic vs Microservices: Key Concepts

Simple System Design and Software Engineering Notes

Uploaded by

Arijit Roy
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Software Development & System Design

# Briefly explain Monolithic Architecture


A software architecture where all components like UI, business logic, and database are combined into
a single, tight- coupled unit. It is easy to develop initially but difficult to scale or maintain as the
system grows. Monolithic applications require redeployment of entire system over small changes.

# Briefly explain Microservice Architecture


Microservice architecture breaks an application into small, independent services, each handling a
specific function (like user, payment, or orders). These services communicate via APIs and can be
built, deployed, and scaled separately. It offers flexibility and resilience, but adds complexity in
management and communication.

# Differences between Monolithic & Microservice Architecture

# Briefly explain Proxy


A Proxy is a server that acts as an intermediary between a client and another server. Instead of
connecting directly, the client sends requests to the proxy, which forwards them to the target server
and returns the response. It hides the client’s identity, provides anonymity, can cache content, and
may enforce access control. Forward proxies are mainly used by clients to control and secure ongoing
requests.
# Briefly explain Reverse Proxy
A Reverse Proxy sits in front of backend servers and routes client requests to them. Instead of the
client knowing which server it talks to, the reverse proxy handles the communication. It’s commonly
used for load balancing, caching, SSL termination, and hiding server details to improve security
and performance.
# Differences between Monolithic & Microservice Architecture

# Briefly explain Single Thread


A single thread means a program runs with only one line of execution, handling tasks one after
another in sequence. It is synchronous, so each task must finish before the next one starts. This
makes it simple and easy to manage but can cause blocking if one task takes too long.

# Briefly explain Multi Thread


A multi-threaded program allows a process to run multiple threads concurrently, so different tasks
can be executed at the same time. This makes programs faster, responsive, and efficient, especially
for multitasking. However, it adds complexity with risks like race conditions and deadlocks if not
managed properly.
# Differences between Single Thread and Multi Thread

# Briefly explain Synchronous


Synchronous execution means tasks are carried out one after another in a sequence, where
each task must complete before the next one starts. It is simple and predictable but can cause delays
if one task takes too long, since everything else must wait.

# Briefly explain Asynchronous


Asynchronous execution allows tasks to run independently without waiting for others to finish. A
program can continue doing other work while a task is still in progress, improving speed and
responsiveness. It’s especially useful for I/O operations like network requests or file handling.

# Differences between Synchronous and Asynchronous


# Briefly explain asynchronous behavior of single threaded language
In a single-threaded language (like JavaScript), asynchronous behavior is achieved using an event
loop. Even though only one thread exists, long tasks (like network calls or timers) are offloaded to the
system, and when they finish, their results are placed back in a queue. The event loop then picks them
up when the thread is free.

# What are the two problems with Single Server Setup:

1. SPOF (Single Point of Failure): If the only server crashes or goes down, the entire system
stops working, since everything depends on that one machine.

2. High Latency: As more users send requests, the single server becomes overloaded, causing
slow responses and delays because it can’t handle large traffic efficiently.

# Briefly explain Scale Up or Vertical Scaling:


Scale up (Vertical Scaling) means improving a single server’s capacity by adding more resources like
CPU, RAM, or storage. It makes the existing machine more powerful to handle more load. While simple
to implement, it has hardware limits and can become costly compared to adding more servers.

# Briefly explain Scale Down or Horizontal Scaling:


Scale out (Horizontal Scaling) means adding more servers or machines to distribute the workload
instead of relying on a single powerful server. It improves availability, fault tolerance, and scalability.
However, it requires load balancing and coordination between servers.
# Briefly explain Cache:
Cache is a temporary storage area that stores the result of expensive responses or frequently asked
data.
If data in Cache, read From Cache

cache If data in Cache, save data in Cache DB


Server
Return data

# Advantages of Database Replication:


1. Better Performance
2. Better Reliability
3. Highly Availability

# When to use non-relational database:


1. Your application requires super low latency
2. When your data are unstructured
3. When you need to store a massive amount of data
# Briefly explain CDN:
A CDN (Content Delivery Network) is a network of geographically dispersed servers used to
delivery static contents such as images, videos, CSS files etc. This reduces latency, speeds up
loading times, reduces server load.

# Briefly explain Message Queue:


A Message Queue is a durable component stored in memory that supports asynchronous
communication. It works as a buffer and process asynchronous requests. Producers place messages
in the queue, and consumers process them later, ensuring decoupling, reliability, and load
management.
Consume

MQ Consumer
Procedure publish
Subscribe

# Briefly explain Rate Limiting Algorithm:


A Rate Limiting Algorithm is used to control how many requests a client can make to a server in a
given time frame. It helps prevent abuse, overload, or denial-of-service attacks. We can implement
a rate limiter in client and server side.
# Briefly explain Client-Side Implementation:
Client is an unreliable place to enforce rate limiting, because client request can easily be misled by
malicious actors. Client-side rate limiting means the application itself limits how many requests it
sends to a server within a given time frame. This prevents accidental overload, reduces chances of
being blocked, and ensures fair API usage.

# Briefly explain Server-Side Implementation:


Server-side rate limiting is when the server enforces limits on how many requests a client can make
in a given time period. If a client exceeds the limit, the server may reject, delay, or throttle the extra
requests.

Fig: 1 shows a rate limiter that is placed on the server side. There is an alternative way. We can create
a rate limiter middleware which throttles requests to the API servers.

You might also like