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
380
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 - Montreal Java User Group 2024-05-21
sullis
0
99
Netty Chicago Java User Group 2024-04-17
sullis
0
470
Java 21 - Portland Java User Group 2023-10-24
sullis
0
250
Microbenchmarking with JMH - Portland 2023-03-14
sullis
0
120
Code generation on the Java VM 2022-04-19
sullis
0
90
Mockito 2022-01-25
sullis
0
160
GitHub Actions 2021-12-16
sullis
0
33
Apache Struts and the Equifax data breach 2021-06-03
sullis
0
48
Guardrail State of the Union 2021-04-13
sullis
0
300
Other Decks in Technology
See All in Technology
地理情報とAPIのトレンド
nagix
0
160
推薦システムを本番導入する上で一番優先すべきだったこと~NewsPicks記事推薦機能の改善事例を元に~
morinota
0
130
データ分析基盤を作ってみよう~設計編~
nrinetcom
PRO
1
110
VPoEの視点から見た、ヘンリーがサーバーサイドKotlinを使う理由 / Why Server-side Kotlin 2024
cho0o0
1
420
Docker互換のセキュアなコンテナ実行環境「Podman」超入門
devops_vtj
6
3.2k
MySQLのロックの種類とその競合
yoku0825
6
1.6k
エンジニア向け会社紹介資料
caddi_eng
14
230k
AI研修【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
130
Flutter研修【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
160
20240724_cm_odyssey_hibiyatech
hiashisan
0
110
[NIKKEI Tech Talk]Bias for Action!! 実践から学ぶための仕組とコミュニティ / Community for Practice and Learning
kanamasa
0
280
テスト・設計研修【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
170
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
17
2.8k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
26
1.8k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
12
3.8k
Side Projects
sachag
451
42k
Adopting Sorbet at Scale
ufuk
71
8.8k
GraphQLの誤解/rethinking-graphql
sonatard
59
9.6k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
78
15k
StorybookのUI Testing Handbookを読んだ
zakiyama
15
4.9k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
149
45k
YesSQL, Process and Tooling at Scale
rocio
166
14k
Mobile First: as difficult as doing things right
swwweet
219
8.8k
Why Our Code Smells
bkeepers
PRO
332
56k
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