Lec 2
Lec 2
FUNDAMENTALS OF DEVOPS
Microservices
• Microservices are an architectural approach to
develop software applications as a collection
of small, independent services that
communicate with each other over a network.
• Instead of building a monolithic application
where all the functionality is tightly integrated
into a single codebase.
• Microservices break down the application into
smaller, loosely coupled services.
How do Microservices work
• Microservices work by breaking down a
complex application into smaller,
independent pieces that communicate
and work together, providing
flexibility, scalability, and easier
maintenance, much like constructing a
city from modular, interconnected
components.
• Modular Structure:
– Microservices architecture breaks down
large, monolithic applications into smaller,
independent services.
– Each service is a self-contained module
with a specific business capability or
function.
– This modular structure promotes flexibility,
ease of development, and simplified
maintenance.
• Independent Functions:
– Each microservice is designed to handle a
specific business function or feature.
– For example, one service may manage user
authentication, while another handles
product catalog functions.
– This independence allows for specialized
development and maintenance of each
service.
• Communication:
– Microservices communicate with each other
through well-defined Application
Programming Interfaces (APIs).
– APIs serve as the interfaces through which
services exchange information and
requests.
– This standardized communication enables
interoperability and flexibility in integrating
services.
• Flexibility:
– Microservices architecture supports the use
of diverse technologies for each service.
– This means that different programming
languages, frameworks, and databases can
be chosen based on the specific
requirements of each microservice.
– Teams have the flexibility to use the best
tools for their respective functions.
• Independence and Updates:
– Microservices operate independently,
allowing for updates or modifications to one
service without affecting the entire system.
– This decoupling of services reduces the risk
of system-wide disruptions during updates,
making it easier to implement changes and
improvements.
– Also Microservices contribute to system
resilience by ensuring that if one service
encounters issues or failures, it does not
bring down the entire system.
• Scalability:
– Microservices offer scalability by allowing
the addition of instances of specific
services.
– If a particular function requires more
resources, additional instances of that
microservice can be deployed to handle
increased demand.
– This scalability is crucial for adapting to
varying workloads.
• Continuous Improvement:
– The modular nature of microservices
facilitates continuous improvement.
– Development teams can independently
work on and release updates for their
respective services.
– This agility enables the system to evolve
rapidly and respond to changing
requirements or user needs.
Components of Microservices Architecture
• Continuous Integration/Continuous
Deployment (CI/CD):
– In a microservices architecture, each service can be
independently developed, tested, and deployed.
CI/CD pipelines are crucial for efficiently managing
the constant updates and releases associated with
microservices.
– DevOps practices emphasize CI/CD pipelines, which
involve automating the building, testing, and
deployment of software.
• Continuous Monitoring and Logging
– Microservices architecture requires robust
monitoring to track the health and
interactions between various services,
aiding in early issue detection and
resolution. DevOps emphasizes continuous
monitoring and logging for real-time
insights into application performance.
Benefits of using Microservices Architecture
There is one more command docker push which will push the
image into the Registry.
Components of Docker
• Docker Clients and Servers– Docker
has a client-server architecture. The
Docker Daemon/Server consists of all
containers. The Docker Daemon/Server
receives the request from the Docker
client through CLI or REST APIs and thus
processes the request accordingly.
Docker client and Daemon can be
present on the same host or different
host.
• Docker Images– Docker images are used to build docker
containers by using a read-only template. The foundation of
every image is a base image eg. base images such as –
ubuntu14.04 LTS, and Fedora 20. Base images can also be
created from scratch and then required applications can be
added to the base image by modifying it thus this process of
creating a new image is called “committing the change”.