Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
SGCE 2015 REST APIs
1. Enlighten your software
REST API design & dev
Domingo Suárez Torres
@domix
http://github.com/domix
http://domingosuarez.com
Una propuesta de: “Como construir APIs REST
para sistemas distribuidos con alta
escalabilidad y resilencia"
1/jul/2015
4. Disclaimer
• This talk and its contents are based in my own
experience.
• I’m not trying to say all the following IS the way to
do the right thing. Just my opinion. :)
• All I want is to share my experience with the
community.
• This talk is huge. Hope I can finish on time.
5. Context
• I’m not covering Hypermedia REST APIs
• I’m a JVM guy, so you will see lots of JVM
references. Sorry.
6. Motivation
• Functional requirements is THE challenge.
• API Documentation is always a PITA, keep sync
with the maintenance, new features, fixes, etc.
• Build any API (REST, SOAP, RPC) is hard.
• Development tools choice (programming
language, libraries, frameworks, runtime, etc).
• Non functional requirements, quality attributes.
15. API Contract
• Always is over there. Implicit/Explicit
• You should have one.
• You should know it.
• No matter if you build it or you consume the API.
• You should give it so much love.
• Learn to love it.
17. Contract last
• Sadly is the commonest.
• Server-side developers dictate the contract.
• Most of the time with only one perspective.
• Implementator perspective VS consumer perpective
• Flaky. If missing test cases. Fragile.
• The documentation is done at the end.
• Bottleneck.
37. RAML & code generation
• Server side
• JAX-RS
• Client
• Square Retrofit
• Documentation
• HTML
38. raml2code
• OpenSource project from Grupo Expansión
• Generates Plain Old Java/Groovy Objects
• Generates JAX-RS interfases
• Generates an API client with Retrofit
• Can run in Android also in any JVM application.
39.
40.
41. Nice, now I know how to
create a contract. What’s next?
44. Services
• Build, deploy, and monitor any kind of services in
agile, efficient way with open standards.
• Deployment on-premise, in the cloud, mix of both.
• Deploy services independently from each other.
• Decoupled & scale linearly across commodity
hardware.
52. –Spring Boot reference documentation
“Spring Boot makes it easy to create stand-
alone, production-grade Spring based
Applications that you can “just run”. We take an
opinionated view of the Spring platform and
third-party libraries so you can get started with
minimum fuss. Most Spring Boot applications
need very little Spring configuration.”
53. Spring Boot
• Embedded Servlet container
• Tomcat
• Jetty
• Undertow
• Executable jar file. Key feature for microservices!
• Monitoring capabilities thanks to actuator
• HealthChecks
• Metrics (Dropwizard aka Coda Hale Metrics)
• Jolokia
54. Spring Boot & JAX-RS
• Jersey 2.x support out of the box
• Just use the Jersey Starter
• spring-boot-starter-jersey
• raml2code generates JAX-RS artifacts, remember?
55. Spring Cloud
• Distributed/versioned configuration
• Service registration and discovery
• Routing
• Service-to-service calls
• Load balancing
• Circuit Breakers
• Global locks
• Leadership election and cluster state
• Distributed messaging
56. Netflix OSS
• Netflix is released tons of good stuff.
• Reactive Extensions for Java
• Hystrix (Circuit breaker)
• Eureka (Service registry)
• Archaius (Configuration management)
• Zuul (Dynamic routing, monitoring, resilience, security)
• And many more…