SlideShare a Scribd company logo
1 of 38
Canonical Modeling for
API Interoperability
QCON NEW YORK, JUNE 2014
TED EPSTEIN, FOUNDER AND CEO
MODELSOLV, INC.
1COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Watch the video with slide
synchronization on InfoQ.com!
http://www.infoq.com/presentations
/canonical-models-api-interop
Presented at QCon New York
www.qconnewyork.com
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
Overview
• How APIs help developers, how they don’t
• Canonical models: promises and challenges
• Tackling variability in message representations
• A Better Client Library
• Demo and walkthrough
2COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Developers in the API
Jungle
3COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Services Built in isolation
• Many services built to
service a single
application or org unit.
• No data or API
governance, no shared
data models.
• No meaningful
guidelines. “Just use
schema.”
• No easy path to eventual
integration or promotion
to shared services.
4COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Heavy Burden on Developers
5COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Heavy Burden on Developers
• Find the right
service
6COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Heavy Burden on Developers
• Find the right
service
• Negotiate
data formats
7COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Heavy Burden on Developers
• Find the right
service
• Negotiate data
formats
• Point-to-point
integrations:
each one is
different
8COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Strained Ecosystem
• Bloated code
9COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Strained Ecosystem
• Bloated code
• Memory footprint
10COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Strained Ecosystem
• Bloated code
• Memory footprint
• High integration
costs
11COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Strained Ecosystem
• Bloated code
• Memory footprint
• High integration
costs
• Slow delivery
12COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Canonical Models:
Promises and
Challenges
13COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
A Modest Proposal
• Define a common model for
all data communicated
between systems.
• Common recommendation
in one form or another
◦ Patterns of Enterprise Integration
(Fowler)
◦ SOA Design Patterns (Erl)
14COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Different Uses for Canonical Data
Models:
API Design
◦ SOA Governance: Enforce
consistency with the canonical
model (“canonical schema”)
◦ Tools: Compose message formats
from canonical data models
SDK Development
◦ Abstract physical format
◦ Optimize for performance and/or
developer productivity
Integration
◦ Transform messages to/from
canonical format.
◦ Boundary translation to/from
industry standards
Analysis
◦ Analyzing data landscape, service
landscape
◦ Compliance, internal audit, MDM,
large-scale integration efforts.
15COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Why is this so hard?
Intrinsic Challenges
◦ Getting everyone to the table, getting to
agreement
◦ Versioning, Change impact analysis, and
lifecycle management
Economic Alignment Challenges
◦ Service developers need to get it done
◦ Code-first frameworks promise low-cost
to service developers
Modeling Mismatch: Viewpoint
◦ What's the purpose of the model?
◦ What level of abstraction? What level of
detail?
◦ How does it related to concrete
representations?
Modeling Mismatch: Language
and Method
◦ ER, UML, OWL, etc.
◦ The attractive nuisance of XML Schema
Result: confusion about what the
canonical model is supposed to
be.
16COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
The Pervasive Problem: Variability
• One size fits none
• Message representations vary by
◦ Level of detail
◦ Perspective
◦ Topology, Granularity
◦ Contextual constraints
◦ Metadata
17COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Realization: Decoupling
Models and Messages
18COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Another Look at the Variability Problem
• There’s a common theme
(canon) underneath these
variations.
• Can we describe the theme
and variations separately?
• Can we model the variations
as adaptations,
augmentations of the theme?
• There’s a name for that:
Realization.
19COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Realization: Property Subset
20COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
API requests or
responses may
only need a subset
of properties
defined in the
canonical model.
Realization model
may specify a list
of included
properties.
Realization:
Perspective
21COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Message and resource
structures project
different views from the
same logical data model
Canonical model should
support bi-directional
references.
Realization model should
allow embedded or linked
representations.
Realization:
Metadata
22COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Business Information Model
Account ID
Balance
Margin
Status
Account
Party ID
Name
Party
1
0..n
Data Aspects
· Deltas
· Data Source
· Data Security
· Explicit Null Values
...
Message Structure
<party dataSource=“MSDB”>
<partyId>123</partyId>
<partyName xsi:nil=“true” nullValue=“Not Available” />
<accounts>
<account dataSource=“A2” transType=“insert”>
<accountId>XYZ</accountId>
<balance xsi:nil=“true” isRestricted=“true” />
…
</account>
…
</accounts>
</party>
APIs may need to augment
essential data with descriptive
metadata.
Data aspects are cross-cutting
concerns that may be woven
together with canonical data
as part of the interface
realization.
Realization: Contextual Constraints
<=$10MM
Asset
Class =
Bond
23COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Trade
Services may have specific
constraints that are not
intrinsic to the data
definitions.
Realization model may
specify constraints on
requests or responses.
Constraints may take
different forms: range,
subtype, logical
expression, etc.
Canonical Modeling Reloaded
• New understanding of the model vs. message:
• Canonical data models describe business information at the conceptual level
◦ Semantically rich
◦ Technology independent
• Realization models afford variability, with clear limits
◦ Bend the canonical model, don’t break it
◦ Realized representations must be recognizable as instances of the canonical model.
• Some new terms:
◦ Interface Data Model: A realization model used to define data exchanged through an API.
◦ Resource Data Model: An interface data model for a RESTful (resource-oriented) API.
24COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
A Better Client Library
25COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Today’s
Client Library
26COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
How many ways from Sunday does this
suck?
1. Canonical data model gets lost in the translation.
2. Awkward structures introduced by message format.
3. Annotations are specific to a single API, message format.
4. Not usable as business objects
5. Extra code to populate these DTOs, move data between them and
internal representations.
6. High memory footprint
27COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Just say no
to DTO.
Canonical
Serializer
No DTOs, no need to
code transformations
Single object graph
serialized to multiple
RDMs, message
formats.
Canonical
classes/interfaces can
be used as business
objects.
Flexibility: pluggable
formats for canonical
model, RDM, object
graph and media type.
28COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Canonical Serializer: Implementation
What do we call a serializer that
shoots representations out of a canon?
Kaboom Serializer!
https://github.com/modelsolv/Kaboom
(Just a demo now, but feedback & contributions welcome.)
29COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Scenario
• TaxBlaster: new tax preparation app.
• Integrates with e-filing service
• Integrates with client billing service
• Common data model, different views
30COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
TaxBlaster: Canonical Data Model
31COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
filingID : string
jurisdiction : string
currency : string
year : date
period : int
grossIncome : decimal
taxLiability : decimal
TaxFiling
taxpayerID : string
lastName : string
firstName : string
otherNames : string*
Person
street 1 : string
street2: string
city : string
stateOrProvince : string
postalCode : string
Address
companyID : string
companyName : string
EIN : string
form : string
active : boolean
Company
employees
employer 0..1
0..*
taxpayer
1..1
0..*
addresses
Internal Metamodel
Pluggable
implementations:
• CDM
• RDM
• Canonical Object
Reader/Writer
• Serializer
32COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
name : string
CanonicalDataType
type : primitiveDataType
CDMPrimitiveProperty
CDMReferenceProperty
name : string
cardinality : Cardinality
CDMProperty
properties0..*
inverseProperty
targetDataType
name : string
ResourceDataModel
type : primitiveDataType
RDMPrimitiveProperty
RDMReferenceProperty
name : string
cardinality : Cardinality
RDMProperty
includedProperties0..*
linkRelation : string
ReferenceLink
ReferenceEmbed
embeddedDataModel
Recipe for a model-oriented API client
◦ A canonical modeling language
◦ Data available at runtime that conforms to the canonical model
◦ An API description facility that
◦ Realizes the canonical model as an Interface Data Model
◦ Described as formalized variations
◦ A runtime serializer/deserializer that
◦ Interprets the API model
◦ Serializes and deserializes between the the canonical object graph and the
the realized message format.
33COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Conclusion
Canonical models are a way to capture organizational agreement on
data definitions
We need the right degree of coupling between the canonical model
and API representations.
We do this by identifying the kinds of variations that we need to
support, and formalizing these in a realization mapping.
Tooling can support realization modeling and apply it in client libraries,
SDKs, middleware, etc.
Potential benefits: better interoperability, lower integration cost,
higher developer productivity.
34COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Questions
THANK YOU!
35COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
Watch the video with slide synchronization on
InfoQ.com!
http://www.infoq.com/presentations/canonical-
models-api-interop

More Related Content

More from C4Media

Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaC4Media
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideC4Media
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDC4Media
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine LearningC4Media
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at SpeedC4Media
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsC4Media
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsC4Media
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerC4Media
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleC4Media
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeC4Media
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereC4Media
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing ForC4Media
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data EngineeringC4Media
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreC4Media
 
Navigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery TeamsNavigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery TeamsC4Media
 
High Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in AdtechHigh Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in AdtechC4Media
 
Rust's Journey to Async/await
Rust's Journey to Async/awaitRust's Journey to Async/await
Rust's Journey to Async/awaitC4Media
 
Opportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven UtopiaOpportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven UtopiaC4Media
 
Datadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/DayDatadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/DayC4Media
 
Are We Really Cloud-Native?
Are We Really Cloud-Native?Are We Really Cloud-Native?
Are We Really Cloud-Native?C4Media
 

More from C4Media (20)

Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate Guide
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CD
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine Learning
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at Speed
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep Systems
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.js
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly Compiler
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix Scale
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's Edge
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing For
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data Engineering
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 
Navigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery TeamsNavigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery Teams
 
High Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in AdtechHigh Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in Adtech
 
Rust's Journey to Async/await
Rust's Journey to Async/awaitRust's Journey to Async/await
Rust's Journey to Async/await
 
Opportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven UtopiaOpportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven Utopia
 
Datadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/DayDatadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/Day
 
Are We Really Cloud-Native?
Are We Really Cloud-Native?Are We Really Cloud-Native?
Are We Really Cloud-Native?
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

Recently uploaded (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Canonical Models for API Interoperability

  • 1. Canonical Modeling for API Interoperability QCON NEW YORK, JUNE 2014 TED EPSTEIN, FOUNDER AND CEO MODELSOLV, INC. 1COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 2. InfoQ.com: News & Community Site • 750,000 unique visitors/month • Published in 4 languages (English, Chinese, Japanese and Brazilian Portuguese) • Post content from our QCon conferences • News 15-20 / week • Articles 3-4 / week • Presentations (videos) 12-15 / week • Interviews 2-3 / week • Books 1 / month Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations /canonical-models-api-interop
  • 3. Presented at QCon New York www.qconnewyork.com Purpose of QCon - to empower software development by facilitating the spread of knowledge and innovation Strategy - practitioner-driven conference designed for YOU: influencers of change and innovation in your teams - speakers and topics driving the evolution and innovation - connecting and catalyzing the influencers and innovators Highlights - attended by more than 12,000 delegates since 2007 - held in 9 cities worldwide
  • 4. Overview • How APIs help developers, how they don’t • Canonical models: promises and challenges • Tackling variability in message representations • A Better Client Library • Demo and walkthrough 2COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 5. Developers in the API Jungle 3COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 6. Services Built in isolation • Many services built to service a single application or org unit. • No data or API governance, no shared data models. • No meaningful guidelines. “Just use schema.” • No easy path to eventual integration or promotion to shared services. 4COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 7. Heavy Burden on Developers 5COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 8. Heavy Burden on Developers • Find the right service 6COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 9. Heavy Burden on Developers • Find the right service • Negotiate data formats 7COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 10. Heavy Burden on Developers • Find the right service • Negotiate data formats • Point-to-point integrations: each one is different 8COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 11. Strained Ecosystem • Bloated code 9COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 12. Strained Ecosystem • Bloated code • Memory footprint 10COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 13. Strained Ecosystem • Bloated code • Memory footprint • High integration costs 11COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 14. Strained Ecosystem • Bloated code • Memory footprint • High integration costs • Slow delivery 12COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 15. Canonical Models: Promises and Challenges 13COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 16. A Modest Proposal • Define a common model for all data communicated between systems. • Common recommendation in one form or another ◦ Patterns of Enterprise Integration (Fowler) ◦ SOA Design Patterns (Erl) 14COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 17. Different Uses for Canonical Data Models: API Design ◦ SOA Governance: Enforce consistency with the canonical model (“canonical schema”) ◦ Tools: Compose message formats from canonical data models SDK Development ◦ Abstract physical format ◦ Optimize for performance and/or developer productivity Integration ◦ Transform messages to/from canonical format. ◦ Boundary translation to/from industry standards Analysis ◦ Analyzing data landscape, service landscape ◦ Compliance, internal audit, MDM, large-scale integration efforts. 15COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 18. Why is this so hard? Intrinsic Challenges ◦ Getting everyone to the table, getting to agreement ◦ Versioning, Change impact analysis, and lifecycle management Economic Alignment Challenges ◦ Service developers need to get it done ◦ Code-first frameworks promise low-cost to service developers Modeling Mismatch: Viewpoint ◦ What's the purpose of the model? ◦ What level of abstraction? What level of detail? ◦ How does it related to concrete representations? Modeling Mismatch: Language and Method ◦ ER, UML, OWL, etc. ◦ The attractive nuisance of XML Schema Result: confusion about what the canonical model is supposed to be. 16COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 19. The Pervasive Problem: Variability • One size fits none • Message representations vary by ◦ Level of detail ◦ Perspective ◦ Topology, Granularity ◦ Contextual constraints ◦ Metadata 17COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 20. Realization: Decoupling Models and Messages 18COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 21. Another Look at the Variability Problem • There’s a common theme (canon) underneath these variations. • Can we describe the theme and variations separately? • Can we model the variations as adaptations, augmentations of the theme? • There’s a name for that: Realization. 19COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 22. Realization: Property Subset 20COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED. API requests or responses may only need a subset of properties defined in the canonical model. Realization model may specify a list of included properties.
  • 23. Realization: Perspective 21COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED. Message and resource structures project different views from the same logical data model Canonical model should support bi-directional references. Realization model should allow embedded or linked representations.
  • 24. Realization: Metadata 22COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED. Business Information Model Account ID Balance Margin Status Account Party ID Name Party 1 0..n Data Aspects · Deltas · Data Source · Data Security · Explicit Null Values ... Message Structure <party dataSource=“MSDB”> <partyId>123</partyId> <partyName xsi:nil=“true” nullValue=“Not Available” /> <accounts> <account dataSource=“A2” transType=“insert”> <accountId>XYZ</accountId> <balance xsi:nil=“true” isRestricted=“true” /> … </account> … </accounts> </party> APIs may need to augment essential data with descriptive metadata. Data aspects are cross-cutting concerns that may be woven together with canonical data as part of the interface realization.
  • 25. Realization: Contextual Constraints <=$10MM Asset Class = Bond 23COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED. Trade Services may have specific constraints that are not intrinsic to the data definitions. Realization model may specify constraints on requests or responses. Constraints may take different forms: range, subtype, logical expression, etc.
  • 26. Canonical Modeling Reloaded • New understanding of the model vs. message: • Canonical data models describe business information at the conceptual level ◦ Semantically rich ◦ Technology independent • Realization models afford variability, with clear limits ◦ Bend the canonical model, don’t break it ◦ Realized representations must be recognizable as instances of the canonical model. • Some new terms: ◦ Interface Data Model: A realization model used to define data exchanged through an API. ◦ Resource Data Model: An interface data model for a RESTful (resource-oriented) API. 24COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 27. A Better Client Library 25COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 28. Today’s Client Library 26COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 29. How many ways from Sunday does this suck? 1. Canonical data model gets lost in the translation. 2. Awkward structures introduced by message format. 3. Annotations are specific to a single API, message format. 4. Not usable as business objects 5. Extra code to populate these DTOs, move data between them and internal representations. 6. High memory footprint 27COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED. Just say no to DTO.
  • 30. Canonical Serializer No DTOs, no need to code transformations Single object graph serialized to multiple RDMs, message formats. Canonical classes/interfaces can be used as business objects. Flexibility: pluggable formats for canonical model, RDM, object graph and media type. 28COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 31. Canonical Serializer: Implementation What do we call a serializer that shoots representations out of a canon? Kaboom Serializer! https://github.com/modelsolv/Kaboom (Just a demo now, but feedback & contributions welcome.) 29COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 32. Scenario • TaxBlaster: new tax preparation app. • Integrates with e-filing service • Integrates with client billing service • Common data model, different views 30COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 33. TaxBlaster: Canonical Data Model 31COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED. filingID : string jurisdiction : string currency : string year : date period : int grossIncome : decimal taxLiability : decimal TaxFiling taxpayerID : string lastName : string firstName : string otherNames : string* Person street 1 : string street2: string city : string stateOrProvince : string postalCode : string Address companyID : string companyName : string EIN : string form : string active : boolean Company employees employer 0..1 0..* taxpayer 1..1 0..* addresses
  • 34. Internal Metamodel Pluggable implementations: • CDM • RDM • Canonical Object Reader/Writer • Serializer 32COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED. name : string CanonicalDataType type : primitiveDataType CDMPrimitiveProperty CDMReferenceProperty name : string cardinality : Cardinality CDMProperty properties0..* inverseProperty targetDataType name : string ResourceDataModel type : primitiveDataType RDMPrimitiveProperty RDMReferenceProperty name : string cardinality : Cardinality RDMProperty includedProperties0..* linkRelation : string ReferenceLink ReferenceEmbed embeddedDataModel
  • 35. Recipe for a model-oriented API client ◦ A canonical modeling language ◦ Data available at runtime that conforms to the canonical model ◦ An API description facility that ◦ Realizes the canonical model as an Interface Data Model ◦ Described as formalized variations ◦ A runtime serializer/deserializer that ◦ Interprets the API model ◦ Serializes and deserializes between the the canonical object graph and the the realized message format. 33COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 36. Conclusion Canonical models are a way to capture organizational agreement on data definitions We need the right degree of coupling between the canonical model and API representations. We do this by identifying the kinds of variations that we need to support, and formalizing these in a realization mapping. Tooling can support realization modeling and apply it in client libraries, SDKs, middleware, etc. Potential benefits: better interoperability, lower integration cost, higher developer productivity. 34COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 37. Questions THANK YOU! 35COPYRIGHT © 2014, MODELSOLV, INC. | ALL RIGHTS RESERVED.
  • 38. Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations/canonical- models-api-interop