Introduction To Micro-Services
Introduction To Micro-Services
Introduction to Micro-Services
with Spring Boot
Prakash Badhe
prakash.badhe@vishwasoft.in
About Me: Prakash Badhe 2
About you..
Prerequisite : Experience with server side java applications
development and deployment.
Linux system commands exposure.
Tell about your
Objectives for this Training
Job Role and skill-Set : In web application development.
Experience in different Technologies and tools.
Prior experience with Virtual machines, Docker or any
other tools on Linux platforms.
Setup 4
Vishwasoft Technologies
5
Vishwasoft Technologies
Why SOA..? 6
• Distributed Processing..
• Applications need data sharing and communication in the network
across different machines.
• Heterogeneous applications with different programming and different
Operating systems.
• Lots of data compatibility issues
• Standard protocol and data format needed.
Vishwasoft Technologies
7
Applications as services
• At abstract level if the applications are
defined as platform independent services,
then they can share the data and
understand the data exchange...
• The SOA is the answer..
• Service Oriented Architecture.
Vishwasoft Technologies
8
Service Oriented Architecture
• In a service-oriented architecture, applications
are made up from loosely coupled software
services, which interact to provide all the
functionality needed by the application.
• The applications exchange information across
the platforms.
• Each service is generally designed to be very
self-contained and stateless to simplify the
communication that takes place between them.
Vishwasoft Technologies
9
Roles Involved In A SOA
Three main roles involved in a service-oriented
architecture
– Service provider
– Service broker
– Service requestor
Vishwasoft Technologies
10
SOA Communication Model
Service
Broker
Machine 2
Service Service
Requestor bind Provider
Machine 1 Machine 3
Web
Hosting
Service
Vishwasoft Technologies
12
RPC/RMI Architecture
rebind (“MyObj”, obj)
RMIRegistry
(port No 1099)
(Hello) lookup (“MyObj”)
(Hello) .sayHello( )
Vishwasoft Technologies
13
Service Registry
Find Publish
Invoke
[RPC]
Vishwasoft Technologies
Web Service client
Web Service Deployed
14
Web Programming Model
• Involves client-server interaction on web.
• Uses http protocol and html for information exchange
• Exchange Messages that carry MIME-typed data
• Web applications are loosely coupled than the traditional
distributed programming models like RPC, DCOM, and
CORBA.
Vishwasoft Technologies
15
Vishwasoft Technologies
16
Web service features
• Loosely coupled Web programming model for use in
applications that may not be browser-based.
• Provides a platform for building distributed applications
using software components that are..
– running on different operating systems and devices,
– written using different programming languages and tools from
multiple vendors,
– all developed and deployed independently
Vishwasoft Technologies
17
Clients for Web Service
Servlets, jsp
xml
Service
Vishwasoft Technologies
Provider
18
XML Usage
• Web Services fundamentally use XML to
standardize the behaviors and data.
• Key XML standards to understand
– XML : extensible mark up across
programming languages.
– XML Schema specifies xml structure.
– XML Namespace avoids naming conflicts and
categorizes elements as per the functionality
Vishwasoft Technologies
19
Web Service Standards
• SOAP
• – Simple Object Access Protocol for web service
and clients to communicate.
• WSDL
• – Web Service Definition Language for web services
to describe their services and other information.
• UDDI
• – Universal Description, Discovery, and Integration
protocol for Web Services to discover web services.
• All these are specified in XML format.
Vishwasoft Technologies
20
Soap Web Services
• Manage language independent interactions across different
platforms and applications
• Different versions evolved one by one to support additional
features.
• Interoperability is still an issue across different
implementations and versions.
• Heavy dependencies on the soap library and other xml
implementations.
• Non-xml data format support is limited only in the form of
attachments.
• Performance is an issue for mission critical applications.
21
Soap Web Services
RESTing the SOAP ?
Vishwasoft Technologies
33
Scaling the Monolith
Challenging to scale when different modules
have conflicting resource requirements.
Vishwasoft Technologies
34
Monolith- Sharing and Reuse
• The good parts of one application cannot
be shared or re-used by other
applications.
• Sharing of database for other processes
and parallel updates is a challenge.
Vishwasoft Technologies
35
Breaking the Monolith
• The application is architecture is broken into a
set of smaller, interconnected services (isolated
processes) called as micro-services.
• Some micro-services expose a REST, RPC or
message-based API and most services
consume APIs provided by other services.
• Some micro-services might implement a web UI.
• Micro-Services are loosely coupled applications
as services.
Vishwasoft Technologies
36
Monolith to Micro-Services
Vishwasoft Technologies
37
Vishwasoft Technologies
38
MicroService Benefits
• MicroServices reinforce modular structure, which is
particularly important for larger teams.
• Services are easier to deploy, and since they are
autonomous, are less likely to cause entire system
failures when they go wrong.
• With MicroServices you can mix multiple technologies,
languages, development frameworks and data-storage
technologies.
• Reduced complexity.
• Each MicroService is to be deployed independently. As a
result, it makes continuous deployment possible for
complex applications
Vishwasoft Technologies
39
MicroService Benefits
• MicroService architecture enables each service to be
scaled independently.
• Performance is improved.
• Better testability — services are smaller and faster to
test.
• Better deploy-ability — services can be deployed
independently.
• Improved fault isolation; for memory leak in one service
then only that service is affected.
Vishwasoft Technologies
40
Sharing of Database
• Instead of sharing a single database
schema with other services, each service
has its own database schema.
• Tthis can result in duplication of some
data. However, having a database
schema per service is essential to get
the benefit from micro-services, because it
ensures loose coupling.
Vishwasoft Technologies
41
Cost of MicroServices
• Distributed systems are harder to implement, since
remote calls are slow and are always at risk of failure.
Uniform programming model can reduce the difficulties.
• Maintaining strong consistency is extremely difficult for a
distributed system, which means everyone has to
manage eventual consistency. With high availability
nodes in clusters, this effect can be reduced.
• Need a mature operations team to manage lots of
services, which are being redeployed regularly, with
automation CI/CD this can be eased.
• The network, technology, bandwidth limits the
performance and flexibility.
Vishwasoft Technologies
How to de-compose 42
Vishwasoft Technologies
43
Database break-up
Break out database tables, wrap with service
and, update dependencies
Vishwasoft Technologies
44
Service Modules
Vishwasoft Technologies
45
UI Extraction
Vishwasoft Technologies
46
Load Balancing
Vishwasoft Technologies