Microservices are small, independent services that work together to perform a larger task. Each service has a specific function and communicates through an API using a defined interface and protocols. This allows services to be developed and deployed independently while still working together. Some key advantages of microservices include scalability, flexibility, and easier maintenance compared to monolithic applications. However, microservices also increase complexity and overhead due to the distributed nature.
2. What is a service?
“a mechanism to enable access to one or more capabilities, where the
access is provided using a prescribed interface and is exercised
consistent with constraints and policies as specified by the service
description. “
OASIS Reference Model for Service Oriented Architecture
3. What is a service?
“enable access to one or more capabilities”
• Delegated functionality to specialists (no general specialist)
“access is provided using a prescribed interface ”
• Enforces a distributed architecture, communicating by:
• REST, SOAP, AMQP, MSQM, JMS, etc..
” is exercised consistent with constraints and policies as specified by
the service description. ”
• Abides by the Service Contract
5. Service contract
We have to consider:
• Service availability
• Service responsiveness
• Circuit breaker pattern (if service is not in-memory/remote)
• Versioning (heterogeneous or homogeneous)
• Security (e.g. authentication)
• Transactions (ACID compliance)
6. Example
• Sys AV Scanner
• Enables access to a virus scanning service
• Access is provided using REST
• Responds using JSON
• Sys understands the communication protocol “inbound data”
• Sys understands the response “outbound data”
7. Advantages
• Scalable
• Decoupled
• Better control over development, testing and deployment
• Easier maintenance
• and theoretically is costs less for the business [once it’s up and running]
8. Heterogeneous & Homogeneous Versioning
Homogeneous versioning uses version numbers across the same
contract.
Heterogeneous versioning uses different types of the same contract.
9. Disadvantages
• Increased complexity
• Increased cost
• Service contracts can be difficult
• What happens if a service I need to connect to is no longer available?
11. Characteristics: Taxonomy
Two types of classification:
• Service Type
Type of role the service plays in the overall architecture
• Business Area
Type of role the service plays in the business application
13. Characteristics: Granularity
Microservices are small, fine-grained services. They do one thing, and
they do it well.
• Granularity affects performance!
• Service Contract overhead can add 100ms to the total response time
• Can impede ACID compliance if services are too granular
14. Characteristics: Choreography / Orchestration
Orchestration: coordination with a central mediator
Choreography: coordination without a central mediator
Microservices favour orchestration over choreography
Too much choreography can lead to higher efferent coupling
• The degree to which one component is dependent on other components to
complete a single business request
16. Characteristics: Topology
Microservices have an API layer
• Mediator in service orchestration
• Server-access façade
• Introduces abstraction
• Context awareness
• Each service can share or have its
own access to the infrastructure
layer.
18. Capabilities: Heterogeneous Interoperability
The ability to integrate different programming languages and platforms
• Microservices support protocol-aware-heteronegeous-interopability
• Protocol between API layer and service MUST be the same
• SOA also supports protocol-agnostic-heterogeneous-interopability
• Hallelujah for that protocol-transforming middleware
20. Contract decoupling
• Allow services to consume a message that does not abide to the
service contract
• Message Transformation
• Convert XML to JSON
• Message Enhancement
• Normalise date/time format
21. Mediation / Routing
• Provides the ability to mediate (discover services) and route a request
• A service registry typically acts as the central service configuration
repository
22. Protocol Transformation
• Enables protocol agnostic heterogenous interopability
• Potentially allows service optimisation
• Service A can only communicate in SOAP, Service B is much faster at accepting
requests in REST