Download - API Days Berlin highlights
![Page 1: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/1.jpg)
APIDAYS & APISTRATBerlin, April 23-25, 2015
tech talk @ ferret
Andrii Gakhov
![Page 2: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/2.jpg)
Photos © CHLietzmann
![Page 3: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/3.jpg)
MICROSERVICE ARCHITECTUREa way of designing software applications as suites of
independently deployable services.
![Page 4: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/4.jpg)
• Put every element of functionality into a separate service
• Scale by distributing such services across servers, replicated if needed
• Microservice is not just a Service Oriented Architecture (SOA)
• Communication build on same principles as WWW
• Read more:http://martinfowler.com/articles/microservices.htmlby Martin Fawler and James Lewis
![Page 5: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/5.jpg)
STRUCTURE AND MICRO DEPLOYMETfrom http://martinfowler.com/articles/microservices.html
![Page 6: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/6.jpg)
DECENTRALIZED DATA MANAGEMENTfrom http://martinfowler.com/articles/microservices.html
![Page 7: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/7.jpg)
TOLERATE FAILURE
• Tolerating failure in a Microservice environment is crucial.
• Small independent pieces should mean one thing failing doesn't take out the whole system.
• Lots of small pieces, loosely coupled.
• Key Term: Graceful Degradation
from talk Building Beautiful APIs and Microservices - Brendan McAdams
![Page 8: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/8.jpg)
NANOSERVICES
• Nanoservice is an antipattern where a service is too fine-grained.
• A nanoservice is a ser vice whose overhead (communications, maintenance, and so on) outweighs its utility.
• Micro or not, services should be more useful than the overhear they incur.
from http://arnon.me/2014/03/services-microservices-nanoservices/
![Page 9: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/9.jpg)
HYPERMEDIA APImaking a better API
![Page 10: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/10.jpg)
WHY HYPERMEDIA API
• A problem with APIs is that they leave too much information out, so the developer spends considerable time thinking about how to work with the API.
• Hypermedia APIs solve this problem in such ways:• Provides a shared, common method for developers to interact with data.• Helps developers understand what actions they can perform on the data
using the API.
When an application makes a request using a hypermedia API, it still receives a result (some type of data) in return. However, in addition to the data, the application also receives a list of links that define what the application can do with the data now that it has it.
from http://blog.smartbear.com/apis/hypermedia-apis/working-with-hypermedia-apis/
![Page 11: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/11.jpg)
WHAT IS HYPERMEDIA API• The basis of a Hypermedia API is the registered
hypermedia type used to provide the method of interacting with data.
• A hypermedia type is defined as a Multipurpose Internet Mail Extensions (MIME) type that contains hyper-linking semantics.
• Practical hypermedia types:• Collection+JSON (JavaScript Object Notation)• XHTML (Extensible Hypertext Markup Language)• HAL (Hypertext Application Language)
from http://blog.smartbear.com/apis/hypermedia-apis/working-with-hypermedia-apis/
![Page 12: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/12.jpg)
HAL EXAMPLEfrom http://stateless.co/hal_specification.html
![Page 13: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/13.jpg)
SWAGGER 2.0The World's Most Popular Framework for APIs.
![Page 14: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/14.jpg)
SWAGGERThe goal of Swagger is to define a standard, language-agnostic interface to REST APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection.
• Swagger UI Document and present your API
• Swagger Editor Editor for designing Swagger specification using YAML
• SDK GeneratorsBuild SDK in many languages using Swagger specifications
![Page 15: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/15.jpg)
SWAGGER SPECIFICATIONS EXAMPLE{ "get": { "description": "Returns pets by ID", "summary": "Find pets by ID", "operationId": "getPetsById", "produces": [ "application/json", "text/html" ], "responses": { "200": { "description": "pet response", "schema": { "type": "array", "items": { "$ref": "#/definitions/Pet" } } },
"default": { "description": "error payload", "schema": { "$ref": "#/definitions/ErrorModel" } … }, "parameters": [ { "name": "id", "in": "path", "description": "ID of pet to use", "required": true, "type": "array", "items": { "type": "string" }, "collectionFormat": "csv" …}
![Page 16: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/16.jpg)
SWAGGER UI EXAMPLE
![Page 17: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/17.jpg)
SWAGGER UI EXAMPLE
![Page 18: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/18.jpg)
SWAGGER EDITOR EXAMPLE
![Page 19: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/19.jpg)
COMMUNITY-DRIVEN LANGUAGE INTEGRATIONS
• Clojure• ColdFusion / CFML• Eiffel• Go• Groovy• Java
• JavaScript• Node.js• Perl• PHP• Python• Ruby• Scala
https://github.com/swagger-api/swagger-spec#additional-libraries
![Page 21: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/21.jpg)
• Commercial tool with Freemium model• Works with any API• API user management (with rate limit etc.)• Trafic control• Payment management• Analytics• Read more:
• https://www.youtube.com/watch?v=jaUzKCvwKO4
![Page 24: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/24.jpg)
UI EXAMPLE
![Page 25: API Days Berlin highlights](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a684221a28ab42498b479a/html5/thumbnails/25.jpg)
THANK YOU