Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Topic 1-Monolithic Architecture

Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

Topic 1:

Monolithic
Architecture

ITE-18 APPLICATIONS DEVELOPMENT AND


EMERGING TECHNOLOGY
Monolithic Architecture

Monolithic Application UI

Architecture

Business Logic
Monolithic architecture is a traditional
software design approach where all
components and features of an application
are tightly integrated into a single codebase
and executed as a single unit.
Database
Monolithic Architecture
Traditional Web Application Architecture

StoreFront Accounting
UI Service

MySQL
Browser Apache Database

Inventory Shipping
Service Service

Tomcat
Single Codebase
Key characteristics of Source Files Configuration

Monolithic Architecture (Code) Files

Libraries Test
(Dependencies) (Unit, Integration,
Single Codebase: E2E, etc.)
The entire application's code, Build Scripts
including user interfaces, business (e.g., Makefile,
build.gradle,
logic, and data storage, is written package.json.)
and maintained within a single Documentation
codebase or project. Version Control (Readme, Wiki,
(e.g., Git) API Docs, etc.)

Other Assets
(Images, CSS, etc.)
Key characteristics of Monolithic Architecture

Module A Module B

Tight Coupling: Components and modules Function 1 Function 1


within the application are closely Function 2 Function 2
interconnected, often sharing data and Function 3 Function 3
function calls directly.
Key characteristics of Monolithic Architecture

Single Deployment Unit: The application is


deployed as a whole, making it
straightforward to manage and deploy
updates.
Shared Resources: All components share the
same resources, such as memory and
processing power, which can lead to
resource contention under heavy loads
Key characteristics of Monolithic Architecture

Frontend/UI
Technology Stack Consistency:
Monolithic applications often use a Backend/API
consistent technology stack & Application Logic
throughout, limiting the choice of
Database
the best tools or languages for
specific tasks. Server
Monolithic architectures were popular in the past due to their
simplicity and ease of development.

However, as applications grew in complexity and scalability demands


increased, monolithic architectures started to show limitations:

They could become difficult to maintain


Hindered the adoption of new technologies
Posed challenges when trying to deploy updates without causing
downtime
In response to these challenges, alternative architectural patterns like
microservices and serverless architectures gained traction.
These patterns aim to address the limitations of monolithic architectures
by promoting modularity, flexibility, and scalability.
Example: Monolithic E-Commerce Application

In this example, we'll consider a basic e-commerce application with the following components:

Frontend: The user interface where customers browse products,


add items to their cart, and place orders.

Backend: Handles business logic, manages the product catalog,


processes orders, and communicates with the database

Database: Stores product information, customer data, and


order history.
Example: Monolithic E-Commerce Application
Characteristics of the Monolithic Architecture in the Example:
Frontend: The user interface
where customers browse Single Codebase: All frontend, backend, and database-
products, add items to their related code is written and maintained within a single
cart, and place orders. project.

Tight Coupling: The frontend and backend components


Backend: Handles business
logic, manages the product interact closely, sharing data and functionality directly.
catalog, processes orders, and
communicates with the
Shared Resources: The application uses shared resources,
database
such as server memory and processing power.

Database: Stores product Technology Stack Consistency: The entire application uses a
information, customer data, and
consistent technology stack, limiting the choice of tools for
order history.
specific tasks.
Example: Monolithic E-Commerce Application
Pros and Cons
Frontend: The user interface Pros:
where customers browse Simplicity: The development process is straightforward due to
products, add items to their the unified codebase.
cart, and place orders. Ease of Deployment: Updating the application involves
deploying a single unit, reducing complexities.
Resource Efficiency: Shared resources can be more efficiently
Backend: Handles business
utilized for smaller applications.
logic, manages the product
catalog, processes orders, and Cons:
communicates with the Scalability: Scaling the application can be difficult, as all
database components must be scaled together, even if some components
require more resources than others.
Database: Stores product Flexibility: Choosing the best technology or language for each
information, customer data, and component may not be possible due to the consistent stack.
order history. Maintenance: As the application grows, maintenance becomes
complex, and changes can affect the entire system.
Key components of monolithic applications Frontend/UI Backend/API &
A monolithic application typically consists of key components tightly Application Logic
User Interface
integrated into a single codebase. Routing
Components Authentication
User Interface (UI) Layer: This component represents the user
Templates
interface of the monolithic application. It includes user interface Business Logic

components, templates, and any client-side logic for rendering and


interacting with the user. Database

Monolithic application
Data Storage
Backend/API & Application Logic: This component encompasses
the backend of the application, handling requests, authentication, Queries

business logic, routing, and serving data to the frontend.


External Services/APIs
Database: The database component represents the storage
system where application data is stored and retrieved. It Payment Gateway

includes data storage, queries, and data manipulation logic. Third-Party


Integrations
External Services/APIs: This section shows any external
services or APIs that the monolithic app interacts with, such
as payment gateways and third-party integrations Libraries

Utility
Libraries: This component includes utility libraries and
dependencies used throughout the application stack to Libraries

enhance functionality or streamline development.


Benefits of monolithic architecture
Simplicity: Monolithic applications have a single codebase, which simplifies
development, testing, and maintenance. Developers only need to work within a
single project, making it easier to understand the entire application's functionality.

Ease of Development: With all components tightly integrated, it's easier to


develop features that span multiple parts of the application. Changes made in
one part can be immediately tested with the rest of the application.

Rapid Prototyping: Monolithic architecture is well-suited for quickly prototyping


and building minimum viable products (MVPs). Development cycles can be
shorter, allowing teams to get a product to market faster.

Faster Debugging: Debugging is simpler since all components are closely


connected. Developers can trace the problem within a unified codebase if an issue
arises.
Benefits of monolithic architecture

Centralized Security: Security measures and authentication mechanisms can be


more easily centralized and applied consistently across the entire application.

Lower Latency: Communication between components within the same codebase


typically involves lower latency compared to communication between different
microservices in a distributed system.
Resource Efficiency: Monolithic applications often require fewer resources compared
to distributed systems, as they don't have the overhead of inter-service
communication.
Simplified Deployment: Deploying a monolithic application involves deploying a
single unit, which can be less complex compared to orchestrating deployments
across multiple services in a distributed architecture.
Benefits of monolithic architecture
Consistent Technology Stack: A consistent technology stack simplifies development
and reduces the need to manage compatibility issues between different
technologies.
Easier Testing: Comprehensive end-to-end testing is more straightforward in
monolithic architectures due to the integrated nature of the application.

Team Collaboration: Developers can work on different parts of the application


without managing complex inter-service communication protocols, facilitating
collaboration.
Predictable Performance: As components share resources, performance
characteristics are more predictable since distributed system complexities
introduce no variability.
Cost-Effective for Small Applications: A monolithic architecture can be cost-effective
and efficient for smaller applications or those with limited scalability requirements.
Drawbacks of monolithic architecture
Scalability Challenges: Monolithic applications can be difficult to scale efficiently.
If a specific component of the application requires more resources, the entire
application must be scaled, even if other components don't need additional resources.

Limited Technology Flexibility: Monolithic applications often use a single technology


stack throughout. This can limit the ability to use the best-suited tools and
technologies for different components or tasks within the application.

Deployment Complexity: Deploying updates or new features can become complex as


the application grows. A change to one part of the application might necessitate
redeploying the entire monolith, potentially causing downtime.

Maintenance Complexity: As an application becomes more extensive, maintaining


and debugging the codebase becomes increasingly challenging. Changes in one area
of the application can inadvertently impact other parts.
Drawbacks of monolithic architecture
Team Productivity: As the codebase grows, onboarding new
developers becomes more time-consuming. Additionally,
different teams working on various components can create
bottlenecks and dependencies.
Innovation Constraints: The consistent technology stack and tightly
coupled components can hinder the adoption of new technologies
and methodologies that might be better suited for specific tasks or
features.

Scaling Costs: Scaling a monolithic application often involves


vertically scaling hardware resources, which can be more expensive
than the horizontal scaling typically associated with microservices.

Single Point of Failure: A bug or issue in one component of the


monolith can affect the entire application, leading to potential
downtime for users.
Drawbacks of monolithic architecture
Resource Inefficiency: If different components have varying resource
demands, resource allocation might not be optimized, leading to
overutilization in some areas and underutilization in others.

Longer Development Cycles: As the codebase grows, the time needed to develop
and test new features increases, potentially slowing down development cycles.

Difficulty Adopting Modern Practices: Monolithic architectures might struggle to adopt


modern software development practices such as continuous integration, continuous
delivery, and containerization.
Vendor Lock-in: The decision to use a specific technology stack or framework in a
monolithic application can lead to vendor lock-in, making it challenging to migrate to
alternative solutions.
Complex Rollbacks: In the event of a critical failure after a deployment, rolling back
to a previous state can be complex, as it may involve reverting the entire application.
This ends Topic 1

Thank you!

You might also like