APIs & Underlying Protocols #APICraftSF
-
Upload
andrei-savu -
Category
Technology
-
view
510 -
download
5
Transcript of APIs & Underlying Protocols #APICraftSF
APIs & Underlying ProtocolsLessons · Semantics · Trends
@andreisavu #APICraftSF
Me
Working on Cloudera DirectorPreviously founder of Axemblr.com and Java User Group organizer
More on LinkedIn & @andreisavu
Goal
Share the idea: There is no silver bullet and any implementation must ack network laws
From my experience with:● using multiple cloud provider APIs● using distributed systems (Zookeeper)● writing clients & APIs (jclouds, Director)
http://techblog.netflix.com/2015/02/a-microscope-on-microservices.html
How we build modern applications?
As hybrids
Start: as monolithic systems that use external APIs (identity, analytics, payments, email etc.)
Evolve: collections of services with cohesive APIs (map to organizational boundaries)
What is the role of an API?
Message passing protocol for State Machines
Often seen as replacing libraries in monolithic systems. Dangerous: doesn’t account for network semantics (reason why RPC failed)
What is the role of an API?
Message passing protocol for State Machines
Better: Writing and reading messages on a synchronous queue (producer / consumer). Matches transport layer semantics.
Good API / Bad APIacknowledge the distributed nature of the app
actual choice of technology is orthogonal
Your API is as good as your client library
Users writing their own doesn’t really work (especially for static languages)
Not all protocols are equalWide adoption has important network effects
Gravity. Fashion vs. Technical Merits
How did REST-like succeed?Mix: HTTP, Thin Spec, Partial Adherence
Piggyback on: CDNs, Proxies, Tooling etc.
HTTP/2: new framing layer
maintains HTTP paradigmsame URL structure (including TLS)designed for 1:1 conversion at proxyallows for server push
http://daniel.haxx.se/http2/
APIs better suited for:● low cost batch operations● lower latency● compatibility with next gen CDNs● downside: more complex clients
… but the devil is in the details.
What we can hope w/ HTTP/2?
Take aways
There are no silver bulletsThere has to be substance behind fashionRewriting everything is the normAcknowledge transport layer restrictionsTechnology as a mean-to-an-end