Presentation given during the phpDay 2014 in Verona.
It's about how to build durable web apis based on the experience gained at Namshi while we were developing our SOA architecture
9. Full stack is dead
Microservice Architecture, [...] a
particular way of designing software
applications as suites of
independently deployable services
http://martinfowler.com/articles/microservices.html
â
â
10. Full stack is dead
Microservice Architecture, [...] a
particular way of designing software
applications as suites of
independently deployable services
http://martinfowler.com/articles/microservices.html
â
â
SERVICE-ORIENTED
ARCHITECTURES
23. GET vs POST
âThe difference is that in
a GET request you have the parameters in the url ,
with
a POST the parameters are in the requestâs bodyâ
31. WAKA
âA new protocol designed to
match the efficiency of
well-designed Web
Applicationsâ
http://tools.ietf.org/agenda/83/slides/slides-83-httpbis-5.pdf
77. cURL is your best friend
curl -X GET https://api.namshi.com/products
curl -X POST https://api.namshi.com/order -data=â{...}â
curl -X DELETE ...
curl -X PATCH ...
100. USER TAGS
deleting a non-existent tag
200 or 204 or 404?
http://stackoverflow.
com/questions/2342579/http-status-code-
for-update-and-delete
101. USER TAGS
deleting a non-existent tag
200 or 204 or 404?
http://stackoverflow.
com/questions/2342579/http-status-code-
for-update-and-delete
ON STACKOVERFLOW
THEYâRE
STILL FIGHTING
http://stackoverflow.com/questions/2342579/http-status-code-for-update-and-delete
119. âMost APIs are designed by the API
provider with the goal of maintaining
data model purity. When building an OL,
be prepared to sometimes abandon
purity in favor of optimizations and/or
performance.â
Daniel Jacobson,
director of engineering
for the Netflix API
http://www.infoq.com/presentations/API-Revolution
170. Donât play with fire
POST https://api.example.com/login
200 OK
date: Thu, 01 May 2014 21:52:33 GMT
content-type: application/json
transfer-encoding: chunked
connection: close
set-cookie: login=...;
cache-control: no-cache
{
"email"=>"alessandro.nadalin@gmail.com",
"firstName"=>"Alex",
"lastName"=>"Nadalin",
"birthday"=>"21/10/1988",
}