Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Api Builder - Scala Up North 2017
Search
sullis
July 21, 2017
Technology
0
360
Api Builder - Scala Up North 2017
July 21, 2017
Scala Up North
Vancouver BC
#scala #apibuilder #rest #canada
sullis
July 21, 2017
Tweet
Share
More Decks by sullis
See All by sullis
Netty Chicago Java User Group 2024-04-17
sullis
0
190
Java 21 - Portland Java User Group 2023-10-24
sullis
0
230
Microbenchmarking with JMH - Portland 2023-03-14
sullis
0
98
Code generation on the Java VM 2022-04-19
sullis
0
81
Mockito 2022-01-25
sullis
0
150
GitHub Actions 2021-12-16
sullis
0
28
Apache Struts and the Equifax data breach 2021-06-03
sullis
0
45
Guardrail State of the Union 2021-04-13
sullis
0
280
Guardrail: State of the Union 2021-03-18
sullis
0
140
Other Decks in Technology
See All in Technology
GraphQL 成熟度モデルの紹介と、プロダクトに当てはめた事例 / GraphQL maturity model
mh4gf
7
1.4k
Azure Container Apps + Bicep 〜 こんな感じで運用しています
kaz29
3
610
web-application-security
matsuihidetoshi
1
180
How to do well in consulting–Balkan Ruby 2024
irinanazarova
0
110
Cracking the KubeCon CfP
inductor
2
270
MixIT 2024 - Pulumi : Gérer son infra avec son langage de programmation préféré
ju_hnny5
1
110
FrontDoorとWebAppsを組み合わせた際のリダイレクト処理の注意点
kenichirokimura
1
690
今年のRubyKaigiはProfiler Year🤘
osyoyu
0
270
VSCodeの拡張機能を作っている話
ebarakazuhiro
1
710
require(ESM)とECMAScript仕様
uhyo
4
930
LangSmith入門―トレース/評価/プロンプト管理などを担うLLMアプリ開発プラットフォーム
os1ma
5
660
今日からできる!簡単 .NET 高速化 Tips -2024 edition-
xin9le
7
3.3k
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
It's Worth the Effort
3n
180
27k
Testing 201, or: Great Expectations
jmmastey
29
6.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
20
6.4k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
245
20k
StorybookのUI Testing Handbookを読んだ
zakiyama
13
4.6k
GraphQLとの向き合い方2022年版
quramy
33
12k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
10
1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
10
1.5k
Music & Morning Musume
bryan
41
5.6k
Building Applications with DynamoDB
mza
88
5.6k
A designer walks into a library…
pauljervisheath
201
23k
Transcript
Sean Sullivan July 21, 2017 Scala Up North
• software engineer • 21 years on the JVM •
back office systems @ HBC About me
https://en.wikipedia.org/wiki/Hudson%27s_Bay_Company
None
saksfifthavenue.com saksoff5th.com lordandtaylor.com gilt.com thebay.com
API driven development
API descriptors
API descriptors are not a new concept
• 2000: WSDL 1.0 (SOAP) • 2006: WADL (REST) •
2011: Swagger (REST) • 2014: ApiDoc (REST) • 2017: ApiDoc rebranded to ApiBuilder
www.apibuilder.io
None
describe REST API in a JSON file
1. start by describing your models 2. map your models
to resources
"models": { "credit_card": { "fields": [ { "name": "guid", "type":
"uuid" }, { "name": "user_guid", "type": "uuid" }, { "name": "type", "type": "credit_card_type" }, { "name": "issuer", "type": “string", “required": false }, { "name": "last_four", "type": "string" }, { "name": "expire_date", "type": "string" }, { "name": "billing_address", "type": "address" } ] } }
"resources": { "credit_card": { "operations": [ { "method": "GET", "path":
"/:guid", "description": "Get a credit card.", "responses": { "200": { "type": "credit_card" }, "404": { "type": “unit”, "description": "Card not found." } } } }
gilt.com
www.gilt.com
• Rails app • one Git repo • monolith! Gilt:
2007 => 2008
• Rails app • JSP web framework • ~10 services
(Java) • handcrafted Java clients • weak typing (java.util.HashMap) Gilt: 2009 => 2010
• JSP’s • 100+ services (Java, Scala) • strongly typed
client libraries • Gilt “Commons” library Gilt: 2011 => 2013
• Gilt Commons library • 250+ services • binary coupling
• dependency hell • ApiBuilder project started on Github Gilt: 2014
Dependency hell Java runtime hell
• java.lang.NoClassDefFoundError • java.lang.NoSuchFieldError • java.lang.NoSuchMethodError Java runtime hell
Dependency hell kills productivity
None
Mitigating dependency hell • API design must be first class
• backwards and forward compatibility • accurate documentation • generated client libraries
• 350+ services • new services built with ApiBuilder +
generated clients • Gilt Commons library is deprecated Gilt: 2015 => 2017
Web Checkout Android Checkout iPhone Checkout Checkout service api.json
Generating client libraries with ApiBuilder
Code generators
None
Scala client generators • Http4s + Circe JSON • Ning
AsyncHttpClient {1.8, 1.9} • Play WS {2.2, 2.3, 2.4, 2.5, 2.6}
None
Conclusion • API driven development • visit www.apibuilder.io
The end
None
Bonus material
Gilt 2015