How to Effectively Build Web APIs for
Microservices
APIDays Paris - December 2020
Hello!
Rajith Roshan
Indika Sampath
Technical Lead
indikas@wso2.com
rajithr@wso2.com
Senior Technical Lead
Evolution of Enterprise Architecture
● Designed to facilitate numerous
business requirement
● Software Application offer
hundreds of functions generally
piled into a single runtime
● Use propriety point to point
communication
Monolithic Applications
4
● Introducing the concept of
Service
● Each business functionality is
often implemented as Web
Services
● Expose composite services from
ESB layer
Service Oriented Architecture (SOA) and Enterprise Service Bus
(ESB)
5
● Exposing business functionalities
as managed services/APIs
become a key aspect
● Use API Management/API
Gateway layer on top of the
existing SOA implementations
● Hide the complexity of Web
Service related technologies such
as SOAP, WS-Security, WSDLs
etc.
API Management
6
● Overcome monolithic nature of ESB and service hosting runtime
● Encourage to develop a single application as suite of small and independent
services
● Demolish ESB and Application Server layers, disperse logic into services and
made them accessible through API Manager/Gateway
Microservices
7
Integration never
disappears!
8
9
Where is Integrations?
● Where do we implement functionalities that were offered from ESB
⦿ message routing
⦿ service compositions/chaining
⦿ protocol and message format transformations
⦿ resiliency patterns and various other EIPs?
● Some microservice implementation had the API Gateway as the main
component that take care of various service compositions and orchestrations.
● Some ESB vendors try to resurrect the ESB in microservice architecture, owing
to its fundamental incompatibilities
Microservice Layered Architecture
11
Source: Integration Microservices by Kasun Indrasiri
12
Core/Atomic Services
● Fine-grained self-contained services (no external service dependencies) at the
bottom layer
● Mostly comprise of the business logic and less or no network communication
logic
13
Composite/Integration Services
● ESB/integration capabilities(such as EIPs, resiliency and stability patterns) are
realized in Microservices architecture at the composite/integration services
layer.
● These services also could bridge the other legacy and proprietary systems(e.g
SAP ERP), external web APIs (e.g. Salesforce), shared databases etc.
14
API Services/Edge Services
● Expose a selected set of your composite services or even some atomic service
as managed APIs using API services/Edge services.
● Special type of composite services, that apply basic routing capabilities,
versioning of APIs, API security patterns, throttling, apply monetization, create
api compositions etc.
Microservices with WSO2
16
Demo
Sample Scenario
18
Consumer API Service µ Service 1
APIM Component Architecture
19
API Operator Flow
20
New Requirement
21
Implement New Microservice
22
Consumer API Service µ Service 1 µ Service 2
µ Service 3
● Implement the logic
● Re Implement the error handling
● Address network resiliency through code
● New resources for the new code running
Coding new requirement Can be redoing same thing
23
Can service mesh solve these problems?
Why reinvent to
Integrate?
Integrate with low code
25
Consumer µ Gateway
EI Operator Flow
26
Question Time!
wso2.com
Thanks!

How to Effectively Build Web APIs for Microservices