As microservices-based applications are inherently distributed, the integration of microservices is becoming one of the hardest things when realizing microservices architecture. Rather than using a conventional centralized ESB for integrating services, microservices are integrated based on the smart-endpoints terminology, where all the smarts live at the endpoints while they are interconnected via a lightweight messaging infrastructure. These smart endpoints are often built as integration microservices on top of cloud-native integration technologies.
In this deck, Kasun will explore some key integration patterns for building integration microservices.
2. Rise of Microservices
2
Source : https://www.jitterbit.com/blog/integrating-the-modern-hybrid-cloud-architecture/
● “Microservices architecture is about building a software application as a
collection of independent, autonomous (developed, deployed and scaled
independently), business capability oriented and loosely coupled services.”
⦿ Source: Microservices for Enterprise
● Elimination of ESB → Smart Endpoint and Dumb Pipes.
3. Centralized integration of Applications, Services, Data and Systems.
● Using an ESB for integration.
● API Gateway to expose your APIs
Centralized/ESB-style Integration
3
Data
API Management
ESB
Applications and
Services
Systems
4. ● Integration is everywhere!
Smart Endpoints and Dumb Pipes
4
API Management
μ service-A μ service-B
Event Broker
μ service-C μ service-F
μ service-D
Proprietary &
Legacy System
Web
APIs/SaaS
μ service-E
5. ● Inter-service communication is essential.
● Capabilities that ESB provided has to be implemented at each service level.
● Integration complexity is not reduced but dispersed across services.
● Proliferation of services makes it even more harder.
Integrating Microservices is hard!
5Uber’s microservice architecture circa mid-2018 from Jaeger
6. ● Service Mesh : An application network infrastructure to build cloud native apps.
● Service Mesh != Distributed ESB.
Service Mesh vs Integration
6Source : https://www.infoq.com/minibooks/service-mesh/
7. Cloud Native Integration
Consumer 1
API Service P API Service Q API Service R API Service S
Consumers
Consumer 2 Consumer 3
μ Service A
Event Bus
Proprietary
& Legacy
Systems
Web API /
SaaS
API Services/
Edge Services
Composite Service/
Integration Services
Core Services/
Atomic Services μ Service I
μ Service H
μ Service J
μ Service E
μ Service C
μ Service D
μ Service G
μ Service B
API
Management
API Gateway
9. ● Scoping the service around the business capability.
● Increases the complexity exponentially.
● E.g.: Uber DOMA
⦿ “... engineers had to work through around 50 services across 12 different teams in
order to investigate the root cause of the problem.”
Finding the right granularity…
9
10. ● Supporting high-level abstractions for inter-service communication.
● Support for multiple protocols and standards.
⦿ HTTP, gRPC, GraphQL, Web Sockets, Web Hooks, SOAP
⦿ Kafka, AMQP, NATS
⦿ FTP, SFTP
⦿ TCP, Rsocket
● Integrating with SaaS, proprietary and legacy systems
⦿ e.g. Salesforce, SAP, Amazon S3, SQS
Abstractions for Inter-Service communication
10
11. ● Service Orchestrations/Active Compositions
● Service Choreography/Reactive Compositions
● Event Sourcing
● CQRS
Service Composition Patterns
11
12. ● Runs natively within Docker and K8s.
● Fast startup time and low resource consumption.
● Application specific abstraction for Kubernetes
⦿ Operator to manage the application on K8s.
⦿ Stateful apps.
Container Native/Kubernetes Native
12
13. ● Forking, Joining, Splitting, Looping, and Aggregation of messages or service calls.
● Enterprise Integration Patterns (EIPs)
⦿ Implemented at each smart endpoint.
⦿ Implemented at the platform level (Kubernetes ++)
Enabling common Integration Patterns
13
Source : https://www.enterpriseintegrationpatterns.com/patterns/messaging/ComposedMessagingWS.html
14. ● “Network is unreliable.. Now and forever!”
● Not all apps runs on top of a service mesh
● Resiliency can be coupled to the business logic of the
service
● Patterns
⦿ Timeout, Retry, Circuit Breaker, Fail-fast, Bulkhead
Resiliency
14Source : https://martinfowler.com/bliki/CircuitBreaker.html
15. ● Dumb brokers with smart consumers
and producers.
● Store and forward.
● Persistent delivery.
● Idempotent messaging.
Message Delivery Semantics
15Source : https://medium.com/@jaykreps/exactly-once-support-in-apache-kafka-55e1fdd0a35f
16. ● Message type mapping and transformations.
● Native support for message formats : JSON, XML,
ProtoBuf, Avro
● Implemented graphically or programmatically.
Complex Type Conversions
16
17. ● Consume a stream of events and produce a resulting event stream
● Event store backbone - Kafka, NATS
● Streaming SQL.
Event Oriented Architecture and Streams
17
Source : https://kafka.apache.org/
18. ● Long running processes stateful processes.
● Compensation and distributed transactions - SAGA.
Workflows and SAGA
18
Source :Microservices for the Enterprise
20. ● An API-centric, cloud-native, and distributed integration platform.
● A unified product offering for:
⦿ Microservices Integration
⦾ A unique low code approach to microservices integration.
⦿ Central Integration with ESB
⦾ A leaner, state of the art Integration runtime for your enterprise.
⦿ Data and Streaming Integration
⦾ Data Integration, CDC and ETL capabilities.
⦿ Integration Connectors
⦾ Integrate with SaaS applications, databases, and B2B systems.
WSO2 Enterprise Integrator 7.1
20
21. ● Microservices Integration
⦿ A unique low code approach to microservices integration.
⦿ Natively supports Kubernetes and Docker.
⦿ Deploy WSO2 integration runtime to host composite microservices that can harness the
power of low code integration approach while reaping the benefits of MSA.
WSO2 Enterprise Integrator 7.1
21
22. ● Central Integration with ESB
⦿ A leaner, state of the art Integration runtime for your enterprise.
⦿ When deployed as an ESB, it supports message routing , transformation, message
mediation, service orchestration, service and API hosting needs as well as any
enterprise integration pattern.
WSO2 Enterprise Integrator 7.1
22
23. ● Streaming Integration
⦿ Build integrations with CDC and ETL capabilities.
⦿ Consume and process streaming data, apply stream processing techniques, integrate
processed data with one or more destinations.
WSO2 Enterprise Integrator 7.1
23
24. ● Visual Tooling
⦿ Visually design, develop, debug, test,
and deploy integration flows
⦿ A drag-and-drop graphical
development environment for WSO2
EI.
WSO2 Enterprise Integrator 7.1
24
25. ● Visual Tooling - Pre-built Integration Templates
⦿ Get started with predefined templates to start the integration scenario.
WSO2 Enterprise Integrator 7.1
25
26. ● Visual Tooling - Powerful Data Transformation
⦿ Supports any kind of data transformation (JSON, XML, CSV) using drag & drop graphical
development environment with real-time evaluation.
WSO2 Enterprise Integrator 7.1
26
28. ● Visual Tooling - Integration Flow
Testing
⦿ Native test framework for
implementing test cases and mock
backend services for integration
artifacts.
⦿ Building Integration tests against
real remote backend systems.
WSO2 Enterprise Integrator 7.1
28
29. ● Integration Connectors
⦿ Makes WSO2 applications communicate with SaaS applications, databases, and B2B
systems straightforward.
⦿ Integration Connectors extends the WSO2 integration runtime engine and hides the
technical complexity in connecting to any external system.
WSO2 Enterprise Integrator 7.1
29
30. ● “Ballerina is an open source programming language and platform for cloud-era
application programmers to easily write software that just works.”
● https://ballerina.io/
Ballerina
30