Web Planning an Effective Integration with a 3rd party API to Scale
Transcript of Web Planning an Effective Integration with a 3rd party API to Scale
![Page 1: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/1.jpg)
Using Web Services for Third party integrations to scale
(mandatory cliché business clipart)
![Page 3: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/3.jpg)
Building Rapport with Audience
• 5 KIDS!• Moved from Small
Washington town, 4 months ago
• Many Web service integrations
![Page 4: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/4.jpg)
Mandatory Animated GIF
![Page 5: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/5.jpg)
What is a web service
• Pipeline for communication• A means to integrate to servers • Often synonymous with an API• Gateway to Saas
![Page 6: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/6.jpg)
Where can I use it
• Maps• Social• Mobile• User Tracking• Data exchange• Automation/Workflow
![Page 7: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/7.jpg)
How do I get started
Google “<BRAND> API Getting Started”
![Page 8: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/8.jpg)
Get all available documentation
• Be greedy about documentation– Get Everything (Yahoo! Maps)– Read it– Learn it
• Identify available metaphors/verbs
![Page 9: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/9.jpg)
REST vs SOAP
REST• Follows philosophy of
open web• Easy to test• Newer and standard• Multiple return formats
– JSON– CSV– XML
• Uses port 80 (Standard)• Easy to Debug
SOAP• XML based• Requires SOAP
scaffolding• XML return format• Older standard• Debugging is a harder• Can handle additional
security/ports
![Page 10: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/10.jpg)
Web Services 101
![Page 11: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/11.jpg)
Favor REST
REST is an acronym for the Representational State Transfer architectural style for distributed hypermedia systems.
You will get started faster
![Page 12: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/12.jpg)
Don’t trust the API
• Verify method names– Input parameters– Return Values• Identify all error codes ahead
of time
– Confirm return structure
![Page 13: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/13.jpg)
Handle all error codes
• Many error codes aren’t documented• Error codes are not priority of API provider• Missing error codes can break your integration
![Page 14: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/14.jpg)
Write POC application
• Prove the API will work– Assume that it will not work– Better to fail implementation early
• POC App should be an inch wide and a mile deep
![Page 15: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/15.jpg)
Identify Technical Resource
• The Webservice will have secret handshakes, Assume that everything is not documented.
• WebServices are often the last piece of the application that is implemented, they are an after thought.– Even when part of architecture
FIND A GUIDE
![Page 16: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/16.jpg)
Multi-threaded parallelization
• Web Services are a single call, even batched, it is call/response.– GET User– GET ListOfUsers
• Single call is fast– Many “single calls” S-L-O-W
• Paging ( still single threaded )• Get all IDs -> Threaded Gets
![Page 17: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/17.jpg)
Use Batch operations
• Time determines winner– Multithreaded API calls ( 22 hours )– Batch operations (20 minutes )
• Flat file– CSV/TSV
![Page 18: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/18.jpg)
Implement retry logic
• Assume API calls will fail• Should have retry
threshold– retry max ‘n’ times
• Retries should have exponential backoff
• Fail BIG
![Page 19: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/19.jpg)
Create strong feedback loop
• How does implementation break• Who hears about it and how?– Email– GitHub– User feedback– SMS
![Page 20: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/20.jpg)
TDD – Testing Driven Development
• APIs tend to change silently• Write unit tests• Run them often
![Page 21: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/21.jpg)
Use technical resource
• Suck up to these people• Get questions answered, don’t feel bad– It is often their job to evangelize
• They are your gateway to the real help– Product managers– Platform programmers– $$$
• Get code review from technical resources
![Page 22: Web Planning an Effective Integration with a 3rd party API to Scale](https://reader033.fdocuments.us/reader033/viewer/2022052602/55cda815bb61eb17148b4677/html5/thumbnails/22.jpg)
Tips for Success
• Create mutual value for third party and self• Regular and ongoing communication• Send thank you notes/gifts• Use back channel communication• Push, but not too hard