- Monolithic Architecture
- Microservice Architecture
We will be reading about
- Introduction to Application Development
- Monolithic Architecture
- Problems With Monolithic
- Microservices as an Alternative --> To achieve loose coupling and downtime be nullified
- Pros and Cons of Microservice Architecture
- Scaling Your Application
- Future Of Serverless/CloudComputing
- Infrastructure As A Code
In Monololith Application Development we divide app into multiple modules.It can have different modules such as UI, Business Logic, Data Access Layer. Disadvantages are if new developer and want to add new codes. It will have to see code dependency.
Monolithic application has single code base with multiple modules. Modules are divided as either for bussiness features or technical features.It has single build system which build entire application and/or dependency.It also has single executable or deployable binary.
Sometimes it is also called mulit-tier architecture because monolithic applications are divided in three or more layers or tire i.e presentation, business, database application.
Difficulties with monolithic application, when it grow
- Large monolithic code base makes complicated to understand,especially for new developer.
- Scaling becomes challenging.
- Continuous integration/deployment become complex and time consuming.You may require dedicated team for build and deploy.
- Overloaded IDE.Large code base makes IDE slow, build time increases.
- Extremely difficult to change technology or language framework because everything is tightly coupled and depend on each other.
Entire paradigm shift from browser / desktop to mobile /smart devices. Enterprise need to serve data to different devices and form factors (smart phone,tablet,handheld etc.)
Microservices architecture is an approach of building large enterprise apps with multiple small unit called service, each service develop, deploy and test individually.
Each service intercommunicate with a common communication protocol like REST web service with JSON.Each service may have own database or storage system or they can share common database or storage system.Microservice is all about distribute or break applications in small chunks.
Each service run individually either in single machine or different machine but they execute its own separate process.
Privilege with Microservice architecture, when it grow
- Each microservice is small and focused on a specific feature/business requirement.
- Microservice can be developed independently by small team of developers(normally 2 to 5 developers).
- Microservice is loosely coupled,means service are independent,in terms of development and deployment both.
- Microservices allows easy and flexible way to integrate automatic deployment with continuous integration tools (for example Jenkins,Hudson). The productivity of a new team member will be quick enough.
- Microservice is easy to scale based on demand.In a nutshell, monlithic vs microservice is like elephant vs ant approach.When you want to build a giant system like elephant or army of ant,small,fast and effective.
Microservices can be deployed in a variety of ways. They can be part of a serverless architecture,hosted in containers, developed using PaaS, or theoritcally used to build a locally hosted application.
However, the advantages of building an application out of microservices are perhaps most apparent when the application is hosted in the cloud,either using containers or in a serverless architecture.
Event Service Bus -> Tools like Kafka , RabbitMq
Fire and Forget which is different than request and reply.
- Decompose by Business Capability
- Decompose by subdomain
- Decompose by Transactions
- Strangler Pattern
- Bulkhead Pattern
- API Gateway Pattern
- Aggregator Pattern
- Proxy Pattern
- Gateway Routing Pattern
- Chained Microservice Pattern