More Related Content
Similar to API First or Events First: Is it a Binary Choice? (20)
More from VMware Tanzu (20)
API First or Events First: Is it a Binary Choice?
- 1. Confidential │ ©2020 VMware, Inc.
API First or Events
First: Is it a Binary
Choice?
Madhav Sathe
Cloud Applications Architect
@madhav_sathe
Last Updated:
September 2020
Rohit Kelapure
Solution Architect VMware
@rkela
APIs or Events ? What Came First ?
https://miro.com/app/board/o9J_koawt4w=/
- 2. Confidential │ ©2020 VMware, Inc. 2
APIs and Events - The fundamental difference?
Consumer
API
Do something for
me
APIs Events
Producer
Something
happened
Consumer
I’m interested in
it
Pub/Sub
Service Mesh and/or API Gateway
- 3. Confidential │ ©2020 VMware, Inc. 3
Your Digital Assets
New Business Channels
Internal
Developers
Partner
Developers
Customer
Developers
ERP, CRM
API Gateway “By 2023, over 50% of B2B transactions
will be performed through real-time APIs
versus traditional approaches.”
- Gartner, Use APIs to Modernize EDI for B2B
Ecosystem Integration, 11 June 2019
✓ Unlock new revenue streams
✓ Enable super infrastructure
✓ Adoption predicts financial
performance
Monetization through APIs
Future growth engine
Business Imperative - APIs
ConsumptionExposure
- 4. Confidential │ ©2020 VMware, Inc. 4
● Predictive analytics
● Fraud detection
● Real-time personalization
● IoT
● Easier to extend
● Autonomy to evolve
independently
● Independence allows
much better agility
● Serverless
● FaaS
Business Imperative - Events
Digital Experience → New
Economic Opportunities
Malleable Systems →
Reduced Time to Market
New Paradigms → Ride the
Cloud Wave
“By 2025, nearly 30 percent of data generated will be real-time” - IDC
- 9. Confidential │ ©2020 VMware, Inc. 9
Monolith
Evolution of Architecture
Customer
Module
Order
Module
Customer Order
- 10. Confidential │ ©2020 VMware, Inc. 10
Microservices with tight coupling
Evolution of Architecture
Customer
Service
Order
Service
Customer Order
A P I A P I
- 11. Confidential │ ©2020 VMware, Inc. 11
Microservices with loose but temporal coupling
Evolution of Architecture
Customer
Service
Order
Service
Customer
A P I A P I
Order
- 12. Confidential │ ©2020 VMware, Inc. 12
Decoupled microservices with thick events
Evolution of Architecture
Customer
Service
Order
Service
Customer
A P I A P I
Order
Customer Events With
State
Order Events With State
Order Query
View
Customer
Query View
- 13. Confidential │ ©2020 VMware, Inc. 13
● API’s externally observed behavior can not
change unless it is backward compatible
● A good API practitioner will have sufficient
tests to ensure backward compatibility
● Spring Cloud Contracts can be included in
CI
● Use events with encoding standards that
support schemas such as Avro
● Use schema registry to ensure
compatibility
● Confluent’s schema registry maven plugin
can be used in CI
API & API Contracts Treat Event Schemas as API Contracts
Managing Evolution Without Breaking Things
Contracts & Compatibility
- 14. Confidential │ ©2020 VMware, Inc. 14
Design Considerations for Events Driven
Event broker
● Delivery guarantees
● Message ordering
Events
● Coupling due to event schema
● Message duplication
State
● Sagas to handle eventual consistency
● Idempotency in operations
Complete
decoupling
comes with a
cost
- 16. Confidential │ ©2020 VMware, Inc. 16
Amundsen API Maturity Model
API First Architecture
Ease Of Consumption
Product
Cetricness
- 17. Confidential │ ©2020 VMware, Inc. 17
Patterns To Manage Uncertainty in Event Driven Architectures
Reference Architectures
- 18. Confidential │ ©2020 VMware, Inc. 18
Docket Based Choreography
Handling Uncertainty with APIs and Events
@shaunanderson
- 19. Confidential │ ©2020 VMware, Inc. 19
Events Based Stateful Streaming
Programming Models with Events
@sina sujoodi
- 20. Confidential │ ©2020 VMware, Inc. 20
Exploit The Best Of Both Worlds
Bringing It Together
Start with APIs and API Gateways
Immediate Impact
Incremental Feature development
Continue to decompose monoliths into a
mesh of microservices
Data Driven Strangler
Model the System as Events
Model Business Domain
Completely Decoupled Microservices
with Event Based Architecture and use
APIs to drive value
End Goal
OPERATIONALIZE SEAMS EVENT DOMAIN MODEL
- 22. Confidential │ ©2020 VMware, Inc. 22
Tradeoffs and Functional choices
Role of APIs and Events in the Design of A Complex System
- 23. Confidential │ ©2020 VMware, Inc. 23
❖ Business
➢ Unlock new business channels by exposing data and services
➢ Montezing services
❖ Access
➢ Access across firewalls
➢ Endpoints in DMZ
➢ Abstract infrastructure and platform operations
➢ Platform & language neutral access to microservices
❖ Modernizing legacy
➢ Extending life of legacy with minimal disruption
➢ Anti-corruption layer
❖ Modern apps
➢ Backend for Frontend
➢ Temporal coupling is required
➢ Standards such as Service Mesh make it easy to implement zero-touch security
When To Use APIs
- 24. Confidential │ ©2020 VMware, Inc. 24
● Loosely Coupled Architecture
○ Temporal decoupling of microservices
○ Independent evolution of microservices
○ Extend architectures - Plug and play new modules
● Enables new Paradigms
○ Serverless microservices
● Data Modernization
○ Change data capture
○ Streaming & data transformation
○ Near real-time analytics
○ Modernizing ETLs
● Scaleable Business Processes
○ Implementing sagas
○ Notifications
When To Use Events
- 25. Confidential │ ©2020 VMware, Inc. 25
● Temporal coupling
● Needs extensive testing to ensure
backward compatibility
●
APIs Events
Challenges with each approach
- 26. Confidential │ ©2020 VMware, Inc. 26
Decoupled microservices with thin events
Evolution of Architecture
Customer
Service
Order
Service
Customer
A P I A P I
Order
Customer Events
Order Events
- 27. Confidential │ ©2020 VMware, Inc. 27
API Maturity Model Comparison
https://medium.com/good-api/api-maturity-fb25560151a3
- 28. Confidential │ ©2020 VMware, Inc. 28
Business Imperative - APIs & Events
Path To App Modernization
Reuse across multiple types of applications
and integrations
Enable Super Infrastructure - Forcing Function
for Value
Inclusive to humans & machines
Adoption helps predict financial performance
Make a system Malleable
Easier to extend
Greater autonomy to act independently
Independence allows much better agility
New paradigms - FaaS & Serverless
API First Business Events First Business