SlideShare a Scribd company logo
Practical application of API-First
approach in microservice
development
22.12.2020
Chavdar Baykov
SolutionArchitect
(Digital Wallets, Paysafe Group)
chavdar.baykov@paysafe.com
• Started programming, with BASIC, when Apple II was a big thing, long, long time ago…
• Spent few years doing competitive programming - algorithms and such…
• Spent 19 years developing and architecting different solutions in SAP
 Java, Web Services, SOAP, JAXB, SAP HANA, SAP Cloud Platform
• Joined Paysafe DigitalWallets July 2019 as SolutionArchitect
• Interests include:
 Pragmatic and Agile Architecture
 Development Productivity
 Clean Code and Clean Architecture
 Tech gadgets…
About Me
2
Importance of APIs ?
3
4
Monolithic vs Microservices Architecture
5
• Tightly coupled
Statically linked dependency
• Very low latency
• “Unlimited” bandwidth
• High data integrity
• Always available
• Single deploy
• Scale vertically
• Inside trust boundary
• Loosely coupled
• High latency and overhead
• Limited bandwidth
• Various data conversions applied
Encodings,XML, JSON, …
• Outages are possible
• Independently deployed
• Horizontally scalable
• Outside trust boundary
Local Calls vs Remote (RESTful) API Calls
6
• Poor development productivity
 Poorly documented
 Hard to use and understand
 Inconsistent interaction patterns
• Poor performance
 Ineffective communication patterns or data structures
• Low reliability
 Incompatible changes are often required or happening
 Interactions end up in undetermined state
 Data Integrity Issues
• High operation cost
Impact of Poor (RESTful) API Design
7
• Use case centric
• Intuitive, clear and consistent
• Stable and self contained
• Well documented
Provide examples and Mock/Test Endpoints
• Formally defined using API definition language
Open API 3.0 or 2.0 specification
• Follow REST best practices
Qualities of Good RESTful APIs
8
How do we build APIs ?
9
Code-First Approach to building APIs
10
Characteristic to Code-First Approach
• Preferred for Speed of Delivery
• APIs are byproduct of Implementation
• API Specification is inferred from the implementation
• No API Contract established upfront
• Long feedback cycle on API Quality
• Data integrity and compatibility issues happen often
• Exposing the implementation Data Model has long term impact
11
Treat APIs as First-Class Citizens
1. Brainstorm
2. Establish stakeholders
3. DesignAPI Contract
4. Create Style Guide
5. Implement API Governance
6. Automate Processes
7. Track and ManageAPIs
8. Provide API Portal for Developers
API-First approach to building APIs
12
Benefits of API-First
• Early feedback on API quality
• Reduces rework
• Developers can work in parallel
• Ensures good development experience
• Reduces middleware use and complexity
13
• Higher learning curve for developers
Open API Specification and JSON Schema
API DesignTools
API Design Best Practices
• Requires initial alignment with stakeholders
• No API Portal orAPI Design tool access or
streamlined development tooling
• High pressure to deliver “something”
Challenges adopting API-First
14
Developer Centric Approach to API-First
• Keep API-Specification close to the implementation and developers
• Stored in Git and all changes are tracked
• Allow various API DesignTools usage
• Web or Desktop API Design tools (on top of Git)
• IntegrateAPI Lifecycle into Software Development and Release Process
• API Publication on API Portal during central build
• Release of associated APIArtifacts, along with service implementation
• Provide Developer friendly environment for API implementation and
consumption
• Server-side stub or Client generation as part of the build process
15
Developer Centric API-First approach in Paysafe
16
DEMO – Calculator Service
1. Define Calculator API
2. Prototype and PublishAPI Candidate to Stakeholders
3. ImplementCalculator API
4. Release API
5. Consume API
17
Tools Used
• GitLab ( https://gitlab.com/ )
 Source Control and Artifact Repository
 Build, Publish and Release pipelines
• stoplight.io ( https://stoplight.io/ )
 API Designer,API Portal, API Mocks, API Linting
• OpenAPI Generator + Custom GeneratorTemplates
 https://github.com/OpenAPITools/openapi-generator
 Generate API serer side stubs
 Generate API clients
• Custom Gradle Plugins
 Simplifying development experience
Questions and Answers
18
Thank You!
Chavdar Baykov
Solution Architect (Digital Wallets, Paysafe Group)
chavdar.baykov@paysafe.com
https://www.linkedin.com/in/chavdar-baykov-8322385/
19

More Related Content

What's hot (20)

PPTX
Our First ADF Experience
Hans De Bal
 
PPTX
Mean machine
Nicu Dine
 
PPTX
Lightweight ESB Alternatives
Chris Haddad
 
PPTX
API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...
Joe Levy
 
PDF
Laravel and CodeIgniter: pros & cons
ElenorWisozk
 
PPTX
Sahi
Sohail Ahmed
 
PDF
Scribe online 03 scribe online cdk and api overview
Scribe Software Corp.
 
PPTX
Tech Talk Live - 5.2 REST APIs
Gavin Cornwell
 
PPTX
Apex world 2018 continuously delivering APEX
Sergei Martens
 
PDF
Getting Started with the WSO2 manager
WSO2
 
PDF
Quality - The key to successful SOA
WSO2
 
PPTX
Tarabica 2019 - Migration from ASP.NET MVC to ASP.NET Core
Miroslav Popovic
 
PPTX
API Gateway: Nginx way
inovia
 
PDF
Launching Activiti v6 (Activiti Community Day Paris 2015)
Joram Barrez
 
PDF
API Management @ Haufe
Haufe-Lexware GmbH & Co KG
 
PDF
A look ahead at RAP (ESE 2010)
Ralf Sternberg
 
PDF
APidays Paris 2019 - Reason for Asynchronous APIs by John Carter, Software AG
apidays
 
PPTX
Building Azure Logic Apps
BizTalk360
 
PPTX
Scribe Online CDK & Connector Development
CloudFronts Technologies LLP.
 
PDF
Serverless Architecture Patterns - Manoj Ganapathi - Serverless Summit
CodeOps Technologies LLP
 
Our First ADF Experience
Hans De Bal
 
Mean machine
Nicu Dine
 
Lightweight ESB Alternatives
Chris Haddad
 
API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...
Joe Levy
 
Laravel and CodeIgniter: pros & cons
ElenorWisozk
 
Scribe online 03 scribe online cdk and api overview
Scribe Software Corp.
 
Tech Talk Live - 5.2 REST APIs
Gavin Cornwell
 
Apex world 2018 continuously delivering APEX
Sergei Martens
 
Getting Started with the WSO2 manager
WSO2
 
Quality - The key to successful SOA
WSO2
 
Tarabica 2019 - Migration from ASP.NET MVC to ASP.NET Core
Miroslav Popovic
 
API Gateway: Nginx way
inovia
 
Launching Activiti v6 (Activiti Community Day Paris 2015)
Joram Barrez
 
API Management @ Haufe
Haufe-Lexware GmbH & Co KG
 
A look ahead at RAP (ESE 2010)
Ralf Sternberg
 
APidays Paris 2019 - Reason for Asynchronous APIs by John Carter, Software AG
apidays
 
Building Azure Logic Apps
BizTalk360
 
Scribe Online CDK & Connector Development
CloudFronts Technologies LLP.
 
Serverless Architecture Patterns - Manoj Ganapathi - Serverless Summit
CodeOps Technologies LLP
 

Similar to Practical Application of API-First in microservices development (20)

PPT
How to design effective APIs
Bansilal Haudakari
 
PPT
Effective API Design
Bansilal Haudakari
 
PPTX
Building a REST API for Longevity
MuleSoft
 
PDF
API Introduction - API Management Workshop Munich from Ronnie Mitra
CA API Management
 
PDF
MuleSoft Surat Meetup#39 - Pragmatic API Led Connectivity
Jitendra Bafna
 
PDF
Navigating-the-API-Ecosystem-Strategies-for-Effective-Management-in-the-Banki...
Techwave Consulting
 
PDF
Space Camp June 2022 - API First.pdf
Postman
 
PDF
Designing Usable APIs featuring Forrester Research, Inc.
CA API Management
 
PPTX
Api design part 1
Ibrahim Elsawaf
 
PDF
Why You Should Be Doing Contract-First API Development
DevenPhillips
 
PDF
INTERFACE, by apidays - How to Win Friends and Influence People with API First
apidays
 
PPTX
API Design – More than just a Payload Definition
Phil Wilkins
 
PPTX
Reaching 1 Million APIs and what to do when we get there
3scale
 
PDF
A_Complete_Guide_to_API_Development.pdf
PamRobert
 
PDF
The API SlideShare for Bankers and Fintech Executives
MX
 
PDF
API Sandbox: Empowering Developer Experience (DX)
Faisal Banaeamah
 
PDF
5 Pillars of Building Enterprise0grade APIs
WSO2
 
PPTX
Why an innovative mobile strategy needs a robust API
Manmohan Gupta
 
PPTX
Why an Innovative Mobile Strategy Requires a Robust API
Software AG
 
PDF
Crafting Consumable APIs
WSO2
 
How to design effective APIs
Bansilal Haudakari
 
Effective API Design
Bansilal Haudakari
 
Building a REST API for Longevity
MuleSoft
 
API Introduction - API Management Workshop Munich from Ronnie Mitra
CA API Management
 
MuleSoft Surat Meetup#39 - Pragmatic API Led Connectivity
Jitendra Bafna
 
Navigating-the-API-Ecosystem-Strategies-for-Effective-Management-in-the-Banki...
Techwave Consulting
 
Space Camp June 2022 - API First.pdf
Postman
 
Designing Usable APIs featuring Forrester Research, Inc.
CA API Management
 
Api design part 1
Ibrahim Elsawaf
 
Why You Should Be Doing Contract-First API Development
DevenPhillips
 
INTERFACE, by apidays - How to Win Friends and Influence People with API First
apidays
 
API Design – More than just a Payload Definition
Phil Wilkins
 
Reaching 1 Million APIs and what to do when we get there
3scale
 
A_Complete_Guide_to_API_Development.pdf
PamRobert
 
The API SlideShare for Bankers and Fintech Executives
MX
 
API Sandbox: Empowering Developer Experience (DX)
Faisal Banaeamah
 
5 Pillars of Building Enterprise0grade APIs
WSO2
 
Why an innovative mobile strategy needs a robust API
Manmohan Gupta
 
Why an Innovative Mobile Strategy Requires a Robust API
Software AG
 
Crafting Consumable APIs
WSO2
 
Ad

Recently uploaded (20)

PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Human Resources Information System (HRIS)
Amity University, Patna
 
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
Ad

Practical Application of API-First in microservices development

  • 1. Practical application of API-First approach in microservice development 22.12.2020 Chavdar Baykov SolutionArchitect (Digital Wallets, Paysafe Group) [email protected]
  • 2. • Started programming, with BASIC, when Apple II was a big thing, long, long time ago… • Spent few years doing competitive programming - algorithms and such… • Spent 19 years developing and architecting different solutions in SAP  Java, Web Services, SOAP, JAXB, SAP HANA, SAP Cloud Platform • Joined Paysafe DigitalWallets July 2019 as SolutionArchitect • Interests include:  Pragmatic and Agile Architecture  Development Productivity  Clean Code and Clean Architecture  Tech gadgets… About Me 2
  • 5. 5 • Tightly coupled Statically linked dependency • Very low latency • “Unlimited” bandwidth • High data integrity • Always available • Single deploy • Scale vertically • Inside trust boundary • Loosely coupled • High latency and overhead • Limited bandwidth • Various data conversions applied Encodings,XML, JSON, … • Outages are possible • Independently deployed • Horizontally scalable • Outside trust boundary Local Calls vs Remote (RESTful) API Calls
  • 6. 6 • Poor development productivity  Poorly documented  Hard to use and understand  Inconsistent interaction patterns • Poor performance  Ineffective communication patterns or data structures • Low reliability  Incompatible changes are often required or happening  Interactions end up in undetermined state  Data Integrity Issues • High operation cost Impact of Poor (RESTful) API Design
  • 7. 7 • Use case centric • Intuitive, clear and consistent • Stable and self contained • Well documented Provide examples and Mock/Test Endpoints • Formally defined using API definition language Open API 3.0 or 2.0 specification • Follow REST best practices Qualities of Good RESTful APIs
  • 8. 8 How do we build APIs ?
  • 9. 9 Code-First Approach to building APIs
  • 10. 10 Characteristic to Code-First Approach • Preferred for Speed of Delivery • APIs are byproduct of Implementation • API Specification is inferred from the implementation • No API Contract established upfront • Long feedback cycle on API Quality • Data integrity and compatibility issues happen often • Exposing the implementation Data Model has long term impact
  • 11. 11 Treat APIs as First-Class Citizens 1. Brainstorm 2. Establish stakeholders 3. DesignAPI Contract 4. Create Style Guide 5. Implement API Governance 6. Automate Processes 7. Track and ManageAPIs 8. Provide API Portal for Developers API-First approach to building APIs
  • 12. 12 Benefits of API-First • Early feedback on API quality • Reduces rework • Developers can work in parallel • Ensures good development experience • Reduces middleware use and complexity
  • 13. 13 • Higher learning curve for developers Open API Specification and JSON Schema API DesignTools API Design Best Practices • Requires initial alignment with stakeholders • No API Portal orAPI Design tool access or streamlined development tooling • High pressure to deliver “something” Challenges adopting API-First
  • 14. 14 Developer Centric Approach to API-First • Keep API-Specification close to the implementation and developers • Stored in Git and all changes are tracked • Allow various API DesignTools usage • Web or Desktop API Design tools (on top of Git) • IntegrateAPI Lifecycle into Software Development and Release Process • API Publication on API Portal during central build • Release of associated APIArtifacts, along with service implementation • Provide Developer friendly environment for API implementation and consumption • Server-side stub or Client generation as part of the build process
  • 15. 15 Developer Centric API-First approach in Paysafe
  • 16. 16 DEMO – Calculator Service 1. Define Calculator API 2. Prototype and PublishAPI Candidate to Stakeholders 3. ImplementCalculator API 4. Release API 5. Consume API
  • 17. 17 Tools Used • GitLab ( https://gitlab.com/ )  Source Control and Artifact Repository  Build, Publish and Release pipelines • stoplight.io ( https://stoplight.io/ )  API Designer,API Portal, API Mocks, API Linting • OpenAPI Generator + Custom GeneratorTemplates  https://github.com/OpenAPITools/openapi-generator  Generate API serer side stubs  Generate API clients • Custom Gradle Plugins  Simplifying development experience
  • 19. Thank You! Chavdar Baykov Solution Architect (Digital Wallets, Paysafe Group) [email protected] https://www.linkedin.com/in/chavdar-baykov-8322385/ 19

Editor's Notes

  • #4: APIs is how software systems communicate. In world of mass digitalization, APIs are, everywhere around us.
  • #5: While in the past APIs were mostly used for external communication, the growing popularity of Microservice based architecture led to the explosion of APIs, both internal and externally facing.
  • #6: Let us see what are the implications of replacing local communication with remote communication, when utilizing microservices architecture. While local API calls are usually statically linked at compile time, remote REST calls are loosely coupled, and with separate lifecycle. You can update the implementation or evolve is separately from the client. Latency and Overhead of Remote REST calls is incomparable to Local API calls. While in monolithic system basically data structures are in consistent in memory format, in remote REST communication Data is encoded and goes through various conversions. Although not discussed often, this threatens data integrity between the communicating parties. Local API is always available. Usually, local database transactions used to enforce database consistency even if the whole application crashes. This is not the case with remote REST calls, where the service might be down at any time, without any client information, whether the API call is processed Independent deployment, means we must watch out for incompatible or braking changes.. As distributed system is not deployed atomically.
  • #7: Poor API Design besides the usual development productivity problems seems to amplify bad effect of all challenges, that come with remote communication. In many ways, poor APIs are direct consequence of lack of understanding of the implications of changing the media from local to remote calls and transport layer specifics. SOAP Efforts are one such example, where REMOTE Call Protocol was designed, with goal to be transport agnostic, and violating many of the transporting protocol principles like HTTP paradigms.
  • #8: Good APIs allow clients to mitigate adequately most of the challenges of using remote APIs. For example, they are designed for idempotency, allow asynchronous processing of long executing operations or provide server-side filtering (minimizing transfer of unneeded data) and pagination. All this needs to be designed into the APIs.
  • #9: Now that we set the tone of what do we expect from good APIs and what we don’t, let us dig into how do we build APIs and how it affects their quality ?
  • #10: One of the most common ways of exposing APIs is using the Code First Approach. Implementation laid out based in requirements and is exposed as RESTful APIs. API Specification is produced as part of build process or at runtime based on the implementation Code is enhanced with additional annotation to facilitate API Generation API is byproduct of the implementation, as a result it is strongly influenced by it.
  • #11: Huge part of the APIs used today are produced this way In some situations, this is considered good approach, like rapid prototyping This approach is preferred for speed of delivery, since no or little time is spent on API design and alignment The API Design is influenced by annotating the implementation Incompatible changes might happen often unintentionally. In most of the cases instead of fixing the implementation companies are introducing complex and expensive to maintain middleware as an effort to make the APIs usable, without refactoring the implementation.
  • #12: While in the code-first approach APIs are somewhat a result of the implementation efforts, the API-First approach reverses the process in the opposite direction. Where the implementation effort is driven by API requirements. In order to structure the approach couple of principles apply when trying apply it. 1. The first Brainstorming phase is also relevant and quite related also to microservices design and consists of distinguishing the API grouping and Domain Models used by different APIs and their ownership. The effort here is mostly to make different APIs in the company, as much self contained as possible and loosely coupled. This will likely make them stable 2. Find out Use Cases for APIs and Establish API Stakeholders. Remember one of the principles of Good APIs is that they are Use Case centric. However, having no stakeholders will hardly tell you how well you match these. Find out what is the minimal context needed for fulfilling the use cases at hand. 3. Design APIs and define them using formal API Definition Language – Open API 3.0 is de-facto industry standard for defining RESTful APIs 4. To achieve API consistency and application of Best Practices, define style guides, do API developers have some guidance, when designing them. 5. API Governance can be achieved through Peer Reviews, Stakeholder feedback and static linting. 6. Automate all processes around API lifecycle management and make it accessible to all parties involved. API Publication , release generation of Client and Server-side artifacts should be automated. 7. Track and manage your APIs – check for redundancy and inconsistencies. 8. Create a central place for internal developers, where developers and various stakeholders can collaborate.
  • #13: APIs are the face of your service! Getting Feedback as early as possible on your API might be highly influential to your implementation approach. Having formal API Specification, defined allows evaluating the API, even before the implementation is available using mocks and finding design issues. Inconsistencies and antipatterns are easily spotted and rectified. Reworking this in later stage, might be impossible, or done at great expense.
  • #14: It is not actually all champaign and roses as implementing API-First comes with its own challenges. - For adopting API-First it is of outmost importance, that API Contract is defined using formal API Specification such as Open API 3.0 and derive the implementation out of this contract. Developers need learn how to describe their APIs using formal API Definition language and the tools used for it. There is no way around that, although there are visually appeal to help with that. - Another important step is to identify stakeholders and use cases for these APIs, so feedback can be collected as early as possible. Ideally even before the implementation started. Often APIs and Services are being built, with the idea on the problems they are about to solve, but the stakeholders are involved very late in API design. When you have API in mind, be sure to have stakeholders in line for it, and ready to validate it. Usually, various tools are adopted with various appeal to different stakeholders, but not well integrated into the overall software development process. Making the tooling well integrated and streamlined, plays a big part into “Selling” the idea to Developers. Since for them this seems way more hassle than “quick and dirty” Code-First approach. Last, but not least, the “API Design Upfront” effort is confused with “Big Design Upfront” architecture approach condemned by Agilists and alike. That misconception it totally wrong, since getting early feedback and making sure Right Things Get Built the Right Way, avoids late and costly rework.