This document discusses monolithic architecture and microservices architecture. It begins by defining monolithic architecture as having a single code base with multiple components/modules. It then lists advantages like being simple to develop, test, deploy and scale, as well as drawbacks like flexibility, maintenance, reliability, and scaling challenges.
Microservices architecture is presented as a solution to problems with monolithic architecture. Each microservice has a specific focus and functionality. Benefits include improved testability, loose coupling, and ability to develop, deploy and scale services independently. Challenges include increased complexity of developing, testing and operating distributed systems.
The document provides examples and discusses strategies for migrating a monolithic system to microservices, technologies
2. Monolithic Architecture
has a single code base with multiple
components/modules/services
• Modules are divided as either for
• Business features
• Technical features
2
3. Advantages and Drawbacks of Monolithic Architecture
Advantages
• Simple to develop
• Simple to test
• Simple to deploy
• You have to copy the packaged application to a server.
• Simple to scale horizontally by running multiple copies behind a load balancer.
Drawbacks
• Flexibility
• Make an application bigger, we have a large complex application
• Maintenance
• If Application is too large and complex to understand, it is challenging to make changes fast and correctly.
• Reliability
• Bug in any module (e.g. memory leak) can potentially bring down the entire process.
• Scaling become challenging
• Modification / Re-Platform
• Continuously deployment become complex and time consuming.
• must redeploy the entire application on each update
• No autonomy in Organization (for build and deploy)
3
4. Problem in
Monolithic Architecture
Solution
Microservices Architecture
• Service-Oriented Architecture (SOA)
• A functional decomposition
• Each one of services has its own database
• The data is only accessible through that service’s API
• Each microservice is small and focused on a
specific feature/ business requirement.
• Sitting in front of those services is the API gateway
4
5. Benefits
• Better testability
• loose coupling
• Microservices can be developed/ deploy/ scale independently
• Develop by using different programming language
• it is not recommended
Disadvantage
• Complexity of developing of distributed system
• must implement the inter-process communication mechanism
• We have to deal with inter-process communication, There are frameworks to doing messaging.
• Complexity of testing distributed system
• Complexity of deploying and operating distributed system
• Handling partial failures
• For instance, some systems are slow, they might not get back a response, so developer should care about this
scenario.
Advantages and Drawbacks of Microservices Architecture
5
8. Solutions - Migrating the Monolithic System into Microservices
Enterprise software application is designed
• to simplify numerous business requirements.
• Software application offers hundreds to functionalities
Migrating a Monolithic system into Microservices
‘Service’ is aggregation and grouping of similar functionalities offered from an
application.
• How to break a Monolithic into Microservices
• Migration must be as smooth as possible
• Users should not feel any change
• Need to put right strategy to obtain good benefits
8
9. Solutions - Migrating the Monolithic System into Microservices
There are different Strategies to migrate /break
Parallel full redesign
Do not touch monolithic application
but start building a parallel application with MS architecture
building a new application with the same functional behavior but with
microservices.
Pros
lesser constraints for developers
Users will not feel any change
Cons
Time consuming and Money
Don’t know the outcome of the effort until all the Time and Money are spent
9
10. Solutions - Migrating the Monolithic System into Microservices
Migrating a Monolithic system into Microservices
Standard Microservices
Identify the independent modules in the monolithic application
Convert the backend functionality into Microservices
Replace all the direct calls for this module across the application with microservice calls
Keep doing the same steps for all the modules
10
11. Solutions - Migrating the Monolithic System into Microservices
Migrating a Monolithic system into Microservices
Self Contained Systems
11
12. Solutions - Designing microservices
For Example
Split the functionalities of the monolith into four different microservices
• inventory
• accounting
• shipping
• store
Each service is fully decoupled from each other
Ensures the agility in development and deployment
12
13. Technologies - Messaging in Microservices
Synchronous Messaging
• Client looks for a timely response from the service and waits till it get it
• REST API is the best choice
• REST provides a simple messaging style implemented with HTTP request-response
• Most microservices implementations are using HTTP along with resource API
• Apache Thrift an alternative protocol to REST/HTTP synchronous messaging
Asynchronous Messaging
• Client does not expects a response immediately
• Client does not accepts a response at all
• STOMP - Streaming Text Oriented Messaging Protocol
• MQTT - MQ Telemetry Transport
• AMQP - Advanced Message Queuing
13
14. Technologies - Service Contracts in Microservices
When we have a business capability implemented as a service
• Need to define and publish the service contract
• To define the contract of the microservices
• WSDL - Web Services Description Language
• The best solution is to use REST API
14
15. Technologies - Message-oriented Middleware (MoM)
• There is a system that has multiple clients, namely, it takes orders from all separate
systems.
• When we have different systems and they want to communicate with each other so
MoM comes in
Message-oriented Middleware (MoM)
• is software or hardware infrastructure supporting sending and receiving messages
between distributed systems.
• Use Message middleware for asynchronous data exchange
• Translating what’s coming out and into systems
• There is a universal translator that is called message broker
• Message broker is a message-oriented middleware server that hosts messaging
destinations (Queue/ Topics)
15
16. Technologies - Message Broker
Message Broker
• is built to extend MQ
• is able to understand the content of each message that it moves through the Broker.
• is tasked with gathering, routing and distributing the messages from senders to the right receivers.
• Can matches and routes communications between services
• The message processing nodes supplied with Message Broker are capable of processing messages from
various sources,
• such as Java Message Service (JMS) providers,
• HyperText Transfer Protocol (HTTP) calls ,
• or data read from files.
Central Message Broker
• Can receive messages from multiple destinations
• Determine the correct destination
• Route the message to the correct channel
16
17. Technologies - Message Broker
Message Queue
• A messaging destination that uses a queue data structure to hold messages
• The alternative to a queue is a topic that provides publish/subscribe semantics.
• Message Q is responsible to handle communication between services (Microservices)
• how using messaging bus / messaging queue.
• Producers send a message (Subscribe the message ) and they get notified
• Broadcasts out to all services in very easy manner
• Small storage system
• Reduce load in the system
• Easy to scale to large system
Message Q should be used in two cases
• Reliability - When we have a lot of microservices to get them to talk effectively with each other
• And a good way to notifying hard-working that do a lot of computational part
• There are some requests, Can you do that job whenever you have time
17
19. Technologies for Messaging Modeling
For message queuing and publish-subscribe use cases
• Apache ActiveMQ
• Google Cloud Pub/Sub
• IBM Websphere MQ
• Amazon SQS
• RabbitMQ
• RocketMQ
• Amazon SNS
• Apache Kafka
19
20. Systems
The different solutions are running on systems
• from Rackspace Virtual machines with Linux
• through Docker containers on Linux
• to Docker containers in Kubernetes
• Rackspace Virtual Cloud Servers
• high-performance,
• reliable servers
• help to grow and scale the business quickly and easily
• Docker containers
• Virtualization technology
• Allow pieces of code to be put into smaller
• Easily transportable
• cost-efficien
• Kubernetes
• Makes managing containers simpler.
• Can help to reduce costs
• Makes containers much more feasible
• Container-Based Autoscaling 20
21. Microservices Architecture on Google App Engine
• Deploy multiple microservices as separate
• Services have full isolation of code
• Versions within services
• Project isolation
• Autoscaling
• load balancing
• Shared resources
21
24. IoT Use cases in the Industry
24
Some business use cases and applications
• Production Visibility
• Higher operator productivity
• Faster improvement cycles
• Reduce the cost of quality management systems
• Improve quality through continuous monitoring