๐๐ ๏ธ DevOps 5.2: Microservices ๐ก๐ณ
"Unleashing Microservices ๐ - DevOps 5.2"
What is Monolithic Architecture?
Monolithic architecture refers to a traditional software design approach in which an entire application is built as a single, self-contained unit. In a monolithic application, all components and functionalities, such as user interfaces, databases, and business logic, are tightly integrated and run within the same process. This architecture is in contrast to microservices, where an application is divided into smaller, loosely coupled services that can be developed, deployed, and scaled independently. Monolithic architectures are characterized by their simplicity but can become complex and difficult to maintain as applications grow in size and scope.
What is Microservice Architecture?
Microservice architecture is a software development approach where an application is structured as a collection of loosely coupled, small, independent services that communicate with each other through well-defined APIs. Each microservice typically represents a specific piece of functionality, and they can be developed, deployed, and scaled independently. This architectural style promotes flexibility, scalability, and ease of maintenance in large and complex applications.
The key characteristics of microservices include:
Independence: Microservices are self-contained, meaning each service has its own codebase, data storage, and often its own database.
Decentralized: Microservices are independently developed, deployed, and managed. Teams can work on different services simultaneously.
Lightweight Communication: Services communicate through lightweight protocols such as HTTP/REST or message queues.
Scalability: Individual services can be scaled independently based on demand, making the architecture suitable for high traffic applications.
Resilience: Failure in one microservice doesn't necessarily bring down the entire application.
Technology Heterogeneity: Different services can use different technologies or programming languages as long as they expose standard APIs.
Easy Maintenance: Smaller codebases are easier to understand, maintain, and update.
Rapid Development: Microservices allow for agile and continuous development practices.
Microservices are often used in modern cloud-based and containerized environments, enabling organizations to build and scale applications more efficiently. However, adopting a microservices architecture comes with its own challenges, particularly in terms of managing the increased complexity of the distributed system and ensuring effective communication between services.
Mircorservice Project:
Emart API Architecture:
STEPS:
Use the vagrant file from the previous blog in this series
Do
vagrant up
andvagrant ssh
.Go to root user using
sudo -i
.Clone the project using
git clone
https://github.com/saswatsam786/emart-devops
.cd into emart folder.
So, build using
docker compose up -d
.To see the application live in the browser get the ip address of the VM or machine and run it on port 80
Then you can delete the container if you want using
docker compose down
.