SlideShare a Scribd company logo
1 of 60
Real-World RESTful Service Development Problems and Solutions
Masoud Kalali @MasoudKalali
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
Speaker
• Masoud Kalali
• Works at ORACLE
• Software engineer, author, blogger…
• @MasoudKalali
Program Agenda
Introduction
Request and Response….
A little bit of security
Performance matters!
More on Request and Response
1
2
3
4
5
Introduction…
To jog our memories 
Caching
Rate
Limiting
Authz Logging
RESTful
Service
Endpoint
Micro
Services
Content
Neg.
HTTP Request
HTTP Response
HTTP Response
Status
PaginationHATEOAS
CDN
EIS
Request and Response….
Content Negotiation
Flexible Request and Response - The problem
• Produce multiple format of the representation
– JSON
– XML
– HTML
• Produce multiple variation of the representation
– For privileged user compared to non privileged user
– For older or newer client versions
– For different type of clients
Flexible response types
Flexible Request and Response
• Produce multiple representation of the same resource
– Based on HTTP headers, accept and media-type (custom/standard)
• List of standard media-types: http://www.iana.org/assignments/media-types/media-types.xhtml
• Custom domain oriented media-types, e.g application/vnd.com.oracle.paas-service+json
– Using URI pattern e.g:
• http://api.domain.com/v1.1/customers/1/orders.xml
• http://api.domain.com/v1.1/customers/1/orders.json
– Agent driven
• Client decide what representation to choose
• Server sent different representations (300 or 406 status and required headers)
– Combination of all
Content Negotiation
Flexible Request and Response – The solution
• On the server side
– @Produce
• Should have matching media-type with request accept header
• Non matching results in 406 - Not Acceptable
– @Consume
• Should have matching media-type with request content-type header
• Non matching results in 415 - Unsupported Media Type
• On the client side
– Set correct content-type
– Set expected accept header
Content Negotiation: JAX-RS and flexible response types
Request and Response….
Resource Versioning
Resource Versioning: The Problem
• Request and or response evolves to be incompatible
– Some attributes are removed from request payload or required in the payload
– Some attributes are added or removed or changed semantically in the response
• Business semantic evolves to become incompatible
– E.g the default is no longer set to be a small coffee cup
– The provisioned service, in a PAAS environment, has caching included by default
– Etc.
How to evolve a resource?
Resource Versioning: Solution alternative
• Version added to resource (URI) (Facebook and Twitter)
• /v1.1/resource/path/orders
• /resource/path/orders?version=1.1
• Client is locked to the version
• Easy to maintain in the server side
• Requires all or none migration of the clients
• Problems like linked resource address stored in client side…
How to evolve a resource?
Resource Versioning: Solution alternative
• Version is negotiated as part of the request using accept header
– Accept=application/vnd.com.oracle.paas.service-v1.1+json
– Accept=application/vnd.com.oracle.paas.service-v2.1+json
• Server code need to handle all supported previous versions
– Same endpoint handling all versions and combination of them
• Easy for clients to use what thy want
• GitHub uses this format
How to evolve a resource?
Resource Versioning: Solution alternative
• No versioning at all!
– There is one interface that evolve every e.g 2 years
• Clients must migrate to the new API
• Old api will be shutdown
– Easy to maintain
– Easy to migrate
• Hard to convince clients to migrate before the cut-off
How to evolve a resource?
Request and Response….
Validation
Validating Request: Problem
• When and how to validate the requests?
– Are parameters in expected format
– Is the payload Json as it is supposed to be?
• When and how to verify the requests?
– Are the parameters meaningful? E.g is there any order with that ID
– Is the payload in expected JSON schema?
Validation before action!
Validating Request: Solution
• Validation goes with versioning and content negotiation
• Unified validation patterns across the codebase
– Codified response format
– Unified response body
• Use annotations and standard validation as much as possible
– Supports common media-types
– Unified with custom coding/template being added
Validation before action!
Request and Response….
Exception Handling
Exception Handling
• Please don’t send back stack trace
– Use an ExceptionMapper as Provider as last line of cleanup!
– Unless in development environment (with some considerations)
• Codify all failures and include cause/action in the response
– Use right http status code
– Add application level code for codifying issues
– Add human understandable message
There are always unforeseen corner cases!
More on Request/Response
• Response status codes
– There are more than 200, 404 and 500!
• Unified response style
– Predictability of response body
– Application specific error code
– Human readable message
– cause/solution
• debugability and traceability
– debugified response
– ECID
– Unified Logging (Facebook Scribe, Google Dapper, Apache Kafka)
How should a resource respond to a request?
A little bit of security
Authentication
Access control
Auditing
Authentication
• Authentication enabled for all resources
• Happens before any other validation
• Exclude the resource patterns that requires no authentication
• No access without validating the authentication token
Know who is requesting a resource
Access control
• Happens after detecting a valid authentication
• Requests are easy to check
– Unless column level checks are required, can be done in simple filter
– Column level access control can be done using media types
• Happens before any validation
– unless params are being used as part of the access check
• JAX-RS 2.1 is going to support declarative security
Check who can access a resource
Auditing/ Access logs
• Keep a rich access log
– Depending on the server you use
• Include the usual who, when, what
• Try using W3C Extended Log File Format if supported by server
• Configure security realm for logging
• Think ahead about incident detection/isolation, etc.
Keep record of security incidents!
Performance matters!
Caching
Problem: Don’t hit the servers too often
• Don’t reproduce the same response twice
• Don’t use bandwidth whenever possible
• Counter network reliability issues
• Counter server downtimes
Being stingy with the resource usage is OK!
Solution: Caching
• Local Cache
• Proxy Cache
• reverse-proxy (cache)
• Server(Application) Level Cache
Being stingy with the resource usage is OK!
Caching
• Use HTTP caching features
• Client aware of provided caching support
• Server evaluate caching related headers
• intermediately hops
• Types of Caching Headers
– Absolute Caching Headers
– Conditional Caching Headers
Application Level Cache
Caching
• From Server side:
– Cache-Control and directives
– Last-Modified
Absolute Caching
HTTP/1.1 200 OK Content-Type: application/json
Cache-Control: private, max-age=86400
Last-Modified: Mon, 08 Sep 2014 16:30:00 GMT
• private
• public
• no-cache
• no-store
• max-age (overrides Expires)
Cache Control Directives
curl -v -X GET -H "If-Modified-Since:Mon, 08 Sep 2014 15:08:27 GMT" http://.../simple/1
Caching
• From client side send headers:
– If-None-Match = "If-None-Match" ":" ( "*" | 1#entity-tag )
• At the server side produce headers:
– Etag, when last-modified is hard to determine or not accurate enough
Conditional
Caching
• Can be used for conflict resolution
• Cache on GET request
• Invalidate cache on PUT, POST or DELETE
• Periodically purge cache entries
• Cache invalidation, eviction is not deterministic
• Give http://www.jboss.org/resteasy a try
– Provides @Cache and @NoCache
– Extension to JAX-RS
More on Caching
Performance matters!
Partial Updates & HTTP PATCH
Problem: Wasting processing and bandwidth when
updating
• Updates are not usually full representation mutation
• No need to process the whole representation to update one attribute
• No need to re-persist the whole representation on change
Only update what needs to be updated!
Solution: Partial Updates & HTTP PATCH
• Partial Updates with PUT
• Partial Updates with POST
• Partial updates with PATCH
• JSON Patch is the future
Only update what needs to be updated!
Partial Updates & HTTP PATCH
• Partially update a JSON document
• Works with HTTP PATCH
• Requires special body syntax and directives
JavaScript Object Notation (JSON) Patch, RFC 6902
PATCH /coffee/orders/1234 HTTP/1.1
Host: api.foo.com
Content-Length: 100
Content-Type: application/json-patch
[
{“op”:"replace", ”path”: "/status", "value": "COMPLETED"}
]
Partial Updates & HTTP PATCH
• Supports six operations in the payload
– op : can be “add”, “replace”, “move”, “remove”, “copy” or “test”
• Another three attributes to describe the op
– path: Location of the target attribute in the JSON document
– value: The new value to be added or to replace another
– from: (Only for move op) specifies the source location
JavaScript Object Notation (JSON) Patch, RFC 6902
Performance matters!
Asynchronous And long running jobs in REST
Problem: Serving more requests on the serverside
• Fixed server side resources
• Heavyweight container threads
• Not keeping container resource longer than needed
Don’t keep unnecessary resources for where not needed!
Solution: Asynchronous And long running jobs in REST
• On the serverside:
– @Asynchronous: Annotate a sub-resource as Asynchronous
– AsyncResponse: Provides results and actions on the running request
• setting timeout
• registering callbacks
• resume, cancel suspended request processing
• updating the response
– @Suspended: To inject a suspended AsyncResponse into a sub-resource parameter
Don’t keep unnecessary resources for where not needed!
Asynchronous And long running jobs in REST
• On the serverside:
– CompletionCallback: Async response processing completion callback
• Response processing completed and sent to client
• Response processing failed with exception
– ConnectionCallback: Client server connection events callback
• Client is disconnected abruptly (before or during writing back the response)
Server side callbacks
Asynchronous And long running jobs in REST
@GET @Produce(“application/json”)
@Asynchronous
public void getOrder(@Suspended AsyncResponse ar, String orderId) {
final String result = prepareResponse(orderId);
ar.resume(result)
}
Some small sample code
Future<Coffee> future = client.target(“/coffees/orderId")
.request()
.async()
.get(Coffee.class);
try {
Coffee coffee = future.get(30, TimeUnit.SECONDS);
} catch (TimeoutException ex) {
//
}
Client Code:
Server Code:
** Alternative to Future is using InvocationCallback to get called when response is back
Few more topics
HATEOAS
Problem: Being perfect according to REST maturity model
– Letting the resource graph describe itself
– Describing the resource graph by name
– Removing dependencies on fixed resource addresses
– Letting clients have easier understanding of the API
How to solve:
{
"order": "120"
"links": [
{"rel": "self", "href":"http://api.dom.com/orders/120"},
{"rel": "cancel", "method":"delete", "href":"http://api.dom.com/orders/120"},
{"rel": "shippingDetails", method: "get", "href":"http://api.dom.com/orders/120/shipping"}
]
}
RESTful design maturity levels (Richardson Maturity Model)
And the maturity model
Level 0: XML RPC/Remoting – One resource and one verb (POST) for everything!
Level 1: Multiple resources, not correct use of verbs
Level 2- Proper use of HTTP verbs
Level 3- HATEOAS – Resource graph
discovery
MaturityGrowth
HATEOAS
• REST maturity model
– The glory comes when you are at HATEOAS level!
• Why to` use HATEOAS
– Describe the resource graph by name
– Remove dependencies on fixed resource addresses
– Let the resource graph describe itself
– Let clients have easier understanding of the API
• When to use HATEOAS
– When one resource has some dependent resources
– What is allowed and what is not (logic)
– What is accessible to a user and what is not (security)
Let the resource graph describe itself
JAX-RS and HATEOAS
• No standard API so far but the following to the rescue
– Link
– UriInfo
– UriBuilder
• JAX-RS extensions and Jeresy specific APIs
– Use https://code.google.com/p/jax-rs-hateoas/ extension
– Use Jeresy specific API
• Use Spring MVC
• Use RESTeasy
• It is not end of the world if you don’t!
Java/EE HATEOAS support out of the box
Few more topics
Localization/Internationalization
Localizations and Internationalization
• One time used messages (not persisted for retrieval)
– Decide the locale using accept-language header
– Produce the right locale representation
• Messages would be used by multiple times(persisted messages)
– Codify every text and set of argument
– Let a last layer filter decide how to process the message code and formatting params
– Let the last layer filter decide what to be the date format and , currency should be
– Let the last layer filter rewrite the response replacing the templates
– Keep every message in a memory cache
Different locale getting the right format and style of messages
Few more topics
Usage Throttling
Problem: Abusing the API, categorizing the users
– Better resource allocation and management
– Prevent and handle abuse
– Provide better support for premium users
Keep tap on how many request one user can send!
Solution: Resource Throttling
• Why use Rate Limiting?
– Prevent and handle abuse
– Provide better support for premium users
• How Rate Limiting works?
– Servlet filter sits in front
– User user tokens or IP addresses as identifiers
– Use in-memory cache for book keeping
– Prevents requests reaching endpoints when limit reached
– Reset/update cached counters when needed
Keep tap on how many request one user can send!
Throttling Patterns
• Response status, headers
– HTTP 429 Too Many Requests error code
– Retry-After header
– X-RateLimit-Limit: ###
– X-RateLimit-Remaining: ###
– X-RateLimit-Reset: EPOCH_SECONDS
• Descriptive response in the requested media type
Headers and response
Throttling Patterns
• Client side
– Use caching
– keep tap on number of requests
– Pay attention to headers
– No brainless loops (polling)
• Server side
– Support caching (etags and max-age)
– provide streaming endpoints when possible (feeds, news, public data)
Best practices
Few more topics
REST and plug-ability and extensibility
MicroServices…
• Same good old modularity with with distributed interfaces
• Plus with communication over HTTP, mostly!
• Plus communication using message passing (services, events, event bus)
• Plus with independent SLDC
• Plus being on different platforms/use different data-store/etc.
– Whatever tools, language, framework that fits better!
How far?
MicroServices
• Advantages
– Simplicity of development and maintenance
– Isolation of requirements and fulfillments
– Scale-up and Scale-down, scale-out and scale-in
– More focused HR managements
– Etc.
• Disadvantages
– Operations Overhead
– High level of DevOps, RE Skills Required
– Complexities of a Distributed System
– Etc.
Pros and Cons
Comments, Questions?
• http://tools.ietf.org/html/rfc6902
• http://tools.ietf.org/html/rfc6901
• http://resteasy.jboss.org/
• https://jersey.java.net/documentation/latest/
• http://tools.ietf.org/html/rfc6585
• http://tools.ietf.org/html/rfc5789
• http://martinfowler.com/articles/richardsonMaturityModel.html
• http://www.slideshare.net/bhaktiks/real-world-restful-service-development-problems-and-
solutions
• CCL photos used in slides:
• https://www.flickr.com/photos/treehouse1977/2892417805/
• https://www.flickr.com/photos/treehouse1977/2892417805/
• https://www.flickr.com/photos/essjay/165928100/
• https://www.flickr.com/photos/jforth/4413370462/
• https://www.flickr.com/photos/sakalak/8737872379/
• https://www.flickr.com/photos/jbparrott/8980026600
• https://www.flickr.com/photos/pentadact/36593493/
• https://www.flickr.com/photos/jasohill/4442279347/
• https://www.flickr.com/photos/mdsharpe/5075953655
• https://www.flickr.com/photos/chuqvr/8329512894/
• https://www.flickr.com/photos/longo/2684733921
• https://www.flickr.com/photos/_davor/14757399908
Resources
Real world RESTful service development problems and solutions

More Related Content

What's hot

TriHUG October: Apache Ranger
TriHUG October: Apache RangerTriHUG October: Apache Ranger
TriHUG October: Apache Rangertrihug
 
Improvements in Hadoop Security
Improvements in Hadoop SecurityImprovements in Hadoop Security
Improvements in Hadoop SecurityDataWorks Summit
 
JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?Edward Burns
 
WebSockets in Enterprise Applications
WebSockets in Enterprise ApplicationsWebSockets in Enterprise Applications
WebSockets in Enterprise ApplicationsPavel Bucek
 
Oracle ADF Architecture TV - Planning & Getting Started - Team, Skills and D...
Oracle ADF Architecture TV -  Planning & Getting Started - Team, Skills and D...Oracle ADF Architecture TV -  Planning & Getting Started - Team, Skills and D...
Oracle ADF Architecture TV - Planning & Getting Started - Team, Skills and D...Chris Muir
 
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFishBatch Applications for Java Platform 1.0: Java EE 7 and GlassFish
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFishArun Gupta
 
Oracle ADF Architecture TV - Design - MDS Infrastructure Decisions
Oracle ADF Architecture TV - Design - MDS Infrastructure DecisionsOracle ADF Architecture TV - Design - MDS Infrastructure Decisions
Oracle ADF Architecture TV - Design - MDS Infrastructure DecisionsChris Muir
 
Improvements in Hadoop Security
Improvements in Hadoop SecurityImprovements in Hadoop Security
Improvements in Hadoop SecurityChris Nauroth
 
Apache Hadoop Security - Ranger
Apache Hadoop Security - RangerApache Hadoop Security - Ranger
Apache Hadoop Security - RangerIsheeta Sanghi
 
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015Edward Burns
 
Apache ranger meetup
Apache ranger meetupApache ranger meetup
Apache ranger meetupnvvrajesh
 
HTTP/2 in the Java Platform -- Java Champions call February 2016
HTTP/2 in the Java Platform -- Java Champions call February 2016HTTP/2 in the Java Platform -- Java Champions call February 2016
HTTP/2 in the Java Platform -- Java Champions call February 2016Ed Burns
 
Oracle ADF Architecture TV - Design - Designing for Security
Oracle ADF Architecture TV - Design - Designing for SecurityOracle ADF Architecture TV - Design - Designing for Security
Oracle ADF Architecture TV - Design - Designing for SecurityChris Muir
 
Curb your insecurity with HDP - Tips for a Secure Cluster
Curb your insecurity with HDP - Tips for a Secure ClusterCurb your insecurity with HDP - Tips for a Secure Cluster
Curb your insecurity with HDP - Tips for a Secure Clusterahortonworks
 
Managing enterprise users in Hadoop ecosystem
Managing enterprise users in Hadoop ecosystemManaging enterprise users in Hadoop ecosystem
Managing enterprise users in Hadoop ecosystemDataWorks Summit
 
The Economies of Scaling Software
The Economies of Scaling SoftwareThe Economies of Scaling Software
The Economies of Scaling SoftwareAbdelmonaim Remani
 
Pimping SQL Developer and Data Modeler
Pimping SQL Developer and Data ModelerPimping SQL Developer and Data Modeler
Pimping SQL Developer and Data ModelerKris Rice
 
Oracle ADF Architecture TV - Development - Logging
Oracle ADF Architecture TV - Development - LoggingOracle ADF Architecture TV - Development - Logging
Oracle ADF Architecture TV - Development - LoggingChris Muir
 

What's hot (20)

TriHUG October: Apache Ranger
TriHUG October: Apache RangerTriHUG October: Apache Ranger
TriHUG October: Apache Ranger
 
Apache Ranger
Apache RangerApache Ranger
Apache Ranger
 
Improvements in Hadoop Security
Improvements in Hadoop SecurityImprovements in Hadoop Security
Improvements in Hadoop Security
 
JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?
 
WebSockets in Enterprise Applications
WebSockets in Enterprise ApplicationsWebSockets in Enterprise Applications
WebSockets in Enterprise Applications
 
Oracle ADF Architecture TV - Planning & Getting Started - Team, Skills and D...
Oracle ADF Architecture TV -  Planning & Getting Started - Team, Skills and D...Oracle ADF Architecture TV -  Planning & Getting Started - Team, Skills and D...
Oracle ADF Architecture TV - Planning & Getting Started - Team, Skills and D...
 
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFishBatch Applications for Java Platform 1.0: Java EE 7 and GlassFish
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish
 
Oracle ADF Architecture TV - Design - MDS Infrastructure Decisions
Oracle ADF Architecture TV - Design - MDS Infrastructure DecisionsOracle ADF Architecture TV - Design - MDS Infrastructure Decisions
Oracle ADF Architecture TV - Design - MDS Infrastructure Decisions
 
Improvements in Hadoop Security
Improvements in Hadoop SecurityImprovements in Hadoop Security
Improvements in Hadoop Security
 
Apache Hadoop Security - Ranger
Apache Hadoop Security - RangerApache Hadoop Security - Ranger
Apache Hadoop Security - Ranger
 
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
 
Apache ranger meetup
Apache ranger meetupApache ranger meetup
Apache ranger meetup
 
HTTP/2 in the Java Platform -- Java Champions call February 2016
HTTP/2 in the Java Platform -- Java Champions call February 2016HTTP/2 in the Java Platform -- Java Champions call February 2016
HTTP/2 in the Java Platform -- Java Champions call February 2016
 
Oracle ADF Architecture TV - Design - Designing for Security
Oracle ADF Architecture TV - Design - Designing for SecurityOracle ADF Architecture TV - Design - Designing for Security
Oracle ADF Architecture TV - Design - Designing for Security
 
Curb your insecurity with HDP - Tips for a Secure Cluster
Curb your insecurity with HDP - Tips for a Secure ClusterCurb your insecurity with HDP - Tips for a Secure Cluster
Curb your insecurity with HDP - Tips for a Secure Cluster
 
The Apache Way
The Apache WayThe Apache Way
The Apache Way
 
Managing enterprise users in Hadoop ecosystem
Managing enterprise users in Hadoop ecosystemManaging enterprise users in Hadoop ecosystem
Managing enterprise users in Hadoop ecosystem
 
The Economies of Scaling Software
The Economies of Scaling SoftwareThe Economies of Scaling Software
The Economies of Scaling Software
 
Pimping SQL Developer and Data Modeler
Pimping SQL Developer and Data ModelerPimping SQL Developer and Data Modeler
Pimping SQL Developer and Data Modeler
 
Oracle ADF Architecture TV - Development - Logging
Oracle ADF Architecture TV - Development - LoggingOracle ADF Architecture TV - Development - Logging
Oracle ADF Architecture TV - Development - Logging
 

Viewers also liked

Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014Brian Cavalier
 
SAP Business One Integration Problems and Solutions - DI server DI API B1WS
SAP Business One Integration Problems and Solutions - DI server DI API B1WSSAP Business One Integration Problems and Solutions - DI server DI API B1WS
SAP Business One Integration Problems and Solutions - DI server DI API B1WSAPPSeCONNECT
 
Visual retail field reporting tool
Visual retail field reporting toolVisual retail field reporting tool
Visual retail field reporting toolJari Anttonen
 
THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS
 THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS
THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONSMarkus Eisele
 
jVoiD - the enterprise ecommerce Java by Schogini
jVoiD - the enterprise ecommerce Java by SchoginijVoiD - the enterprise ecommerce Java by Schogini
jVoiD - the enterprise ecommerce Java by SchoginiSchogini Systems Pvt Ltd
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - CoreDzmitry Naskou
 

Viewers also liked (6)

Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014
 
SAP Business One Integration Problems and Solutions - DI server DI API B1WS
SAP Business One Integration Problems and Solutions - DI server DI API B1WSSAP Business One Integration Problems and Solutions - DI server DI API B1WS
SAP Business One Integration Problems and Solutions - DI server DI API B1WS
 
Visual retail field reporting tool
Visual retail field reporting toolVisual retail field reporting tool
Visual retail field reporting tool
 
THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS
 THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS
THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS
 
jVoiD - the enterprise ecommerce Java by Schogini
jVoiD - the enterprise ecommerce Java by SchoginijVoiD - the enterprise ecommerce Java by Schogini
jVoiD - the enterprise ecommerce Java by Schogini
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - Core
 

Similar to Real world RESTful service development problems and solutions

Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)Sascha Wenninger
 
Designing your API Server for mobile apps
Designing your API Server for mobile appsDesigning your API Server for mobile apps
Designing your API Server for mobile appsMugunth Kumar
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGSiddharth Sharma
 
REST Methodologies
REST MethodologiesREST Methodologies
REST Methodologiesjrodbx
 
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache TomcatCase Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache TomcatVMware Hyperic
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service DesignLorna Mitchell
 
Real-world software design practices when developing ASP.NET web systems by B...
Real-world software design practices when developing ASP.NET web systems by B...Real-world software design practices when developing ASP.NET web systems by B...
Real-world software design practices when developing ASP.NET web systems by B...Bojan Veljanovski
 
Pushing Chemical Biology Through the Pipes
Pushing Chemical Biology Through the PipesPushing Chemical Biology Through the Pipes
Pushing Chemical Biology Through the PipesRajarshi Guha
 
Resilience Planning & How the Empire Strikes Back
Resilience Planning & How the Empire Strikes BackResilience Planning & How the Empire Strikes Back
Resilience Planning & How the Empire Strikes BackC4Media
 
Integration strategies best practices- Mulesoft meetup April 2018
Integration strategies   best practices- Mulesoft meetup April 2018Integration strategies   best practices- Mulesoft meetup April 2018
Integration strategies best practices- Mulesoft meetup April 2018Rohan Rasane
 
Webinar: Best Practices for Upgrading to MongoDB 3.0
Webinar: Best Practices for Upgrading to MongoDB 3.0Webinar: Best Practices for Upgrading to MongoDB 3.0
Webinar: Best Practices for Upgrading to MongoDB 3.0MongoDB
 
(ARC206) Architecting Reactive Applications on AWS | AWS re:Invent 2014
(ARC206) Architecting Reactive Applications on AWS | AWS re:Invent 2014(ARC206) Architecting Reactive Applications on AWS | AWS re:Invent 2014
(ARC206) Architecting Reactive Applications on AWS | AWS re:Invent 2014Amazon Web Services
 
System design for video streaming service
System design for video streaming serviceSystem design for video streaming service
System design for video streaming serviceNirmik Kale
 
Overview of REST - Raihan Ullah
Overview of REST - Raihan UllahOverview of REST - Raihan Ullah
Overview of REST - Raihan UllahCefalo
 
VA Smalltalk Update
VA Smalltalk UpdateVA Smalltalk Update
VA Smalltalk UpdateESUG
 
Introduction to SoapUI day 1
Introduction to SoapUI day 1Introduction to SoapUI day 1
Introduction to SoapUI day 1Qualitest
 
Soap UI - Getting started
Soap UI - Getting startedSoap UI - Getting started
Soap UI - Getting startedQualitest
 
Debugging Microservices - key challenges and techniques - Microservices Odesa...
Debugging Microservices - key challenges and techniques - Microservices Odesa...Debugging Microservices - key challenges and techniques - Microservices Odesa...
Debugging Microservices - key challenges and techniques - Microservices Odesa...Lohika_Odessa_TechTalks
 

Similar to Real world RESTful service development problems and solutions (20)

Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
 
Designing your API Server for mobile apps
Designing your API Server for mobile appsDesigning your API Server for mobile apps
Designing your API Server for mobile apps
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
 
Velocity - Edge UG
Velocity - Edge UGVelocity - Edge UG
Velocity - Edge UG
 
REST Methodologies
REST MethodologiesREST Methodologies
REST Methodologies
 
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache TomcatCase Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service Design
 
Real-world software design practices when developing ASP.NET web systems by B...
Real-world software design practices when developing ASP.NET web systems by B...Real-world software design practices when developing ASP.NET web systems by B...
Real-world software design practices when developing ASP.NET web systems by B...
 
Pushing Chemical Biology Through the Pipes
Pushing Chemical Biology Through the PipesPushing Chemical Biology Through the Pipes
Pushing Chemical Biology Through the Pipes
 
Resilience Planning & How the Empire Strikes Back
Resilience Planning & How the Empire Strikes BackResilience Planning & How the Empire Strikes Back
Resilience Planning & How the Empire Strikes Back
 
Integration strategies best practices- Mulesoft meetup April 2018
Integration strategies   best practices- Mulesoft meetup April 2018Integration strategies   best practices- Mulesoft meetup April 2018
Integration strategies best practices- Mulesoft meetup April 2018
 
Webinar: Best Practices for Upgrading to MongoDB 3.0
Webinar: Best Practices for Upgrading to MongoDB 3.0Webinar: Best Practices for Upgrading to MongoDB 3.0
Webinar: Best Practices for Upgrading to MongoDB 3.0
 
(ARC206) Architecting Reactive Applications on AWS | AWS re:Invent 2014
(ARC206) Architecting Reactive Applications on AWS | AWS re:Invent 2014(ARC206) Architecting Reactive Applications on AWS | AWS re:Invent 2014
(ARC206) Architecting Reactive Applications on AWS | AWS re:Invent 2014
 
System design for video streaming service
System design for video streaming serviceSystem design for video streaming service
System design for video streaming service
 
Overview of REST - Raihan Ullah
Overview of REST - Raihan UllahOverview of REST - Raihan Ullah
Overview of REST - Raihan Ullah
 
VA Smalltalk Update
VA Smalltalk UpdateVA Smalltalk Update
VA Smalltalk Update
 
Introduction to SoapUI day 1
Introduction to SoapUI day 1Introduction to SoapUI day 1
Introduction to SoapUI day 1
 
Soap UI - Getting started
Soap UI - Getting startedSoap UI - Getting started
Soap UI - Getting started
 
WebDev Crash Course
WebDev Crash CourseWebDev Crash Course
WebDev Crash Course
 
Debugging Microservices - key challenges and techniques - Microservices Odesa...
Debugging Microservices - key challenges and techniques - Microservices Odesa...Debugging Microservices - key challenges and techniques - Microservices Odesa...
Debugging Microservices - key challenges and techniques - Microservices Odesa...
 

More from Masoud Kalali

CON 2107- Think Async: Embrace and Get Addicted to the Asynchronicity of EE
CON 2107- Think Async: Embrace and Get Addicted to the Asynchronicity of EECON 2107- Think Async: Embrace and Get Addicted to the Asynchronicity of EE
CON 2107- Think Async: Embrace and Get Addicted to the Asynchronicity of EEMasoud Kalali
 
BOF 2193 - How to work from home effectively
BOF 2193 - How to work from home effectivelyBOF 2193 - How to work from home effectively
BOF 2193 - How to work from home effectivelyMasoud Kalali
 
How to avoid top 10 security risks in Java EE applications and how to avoid them
How to avoid top 10 security risks in Java EE applications and how to avoid themHow to avoid top 10 security risks in Java EE applications and how to avoid them
How to avoid top 10 security risks in Java EE applications and how to avoid themMasoud Kalali
 
Confess 2013: OWASP Top 10 and Java EE security in practice
Confess 2013: OWASP Top 10 and Java EE security in practiceConfess 2013: OWASP Top 10 and Java EE security in practice
Confess 2013: OWASP Top 10 and Java EE security in practiceMasoud Kalali
 
Utilize the Full Power of GlassFish Server and Java EE Security
Utilize the Full Power of GlassFish Server and Java EE SecurityUtilize the Full Power of GlassFish Server and Java EE Security
Utilize the Full Power of GlassFish Server and Java EE SecurityMasoud Kalali
 
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!Masoud Kalali
 
Slides for the #JavaOne Session ID: CON11881
Slides for the #JavaOne Session ID: CON11881Slides for the #JavaOne Session ID: CON11881
Slides for the #JavaOne Session ID: CON11881Masoud Kalali
 
Security in java ee platform: what is included, what is missing
Security in java ee platform: what is included, what is missingSecurity in java ee platform: what is included, what is missing
Security in java ee platform: what is included, what is missingMasoud Kalali
 
An Overview of RUP methodology
An Overview of RUP methodologyAn Overview of RUP methodology
An Overview of RUP methodologyMasoud Kalali
 
An overview of software development methodologies.
An overview of software development methodologies.An overview of software development methodologies.
An overview of software development methodologies.Masoud Kalali
 
NIO.2, the I/O API for the future
NIO.2, the I/O API for the futureNIO.2, the I/O API for the future
NIO.2, the I/O API for the futureMasoud Kalali
 

More from Masoud Kalali (12)

CON 2107- Think Async: Embrace and Get Addicted to the Asynchronicity of EE
CON 2107- Think Async: Embrace and Get Addicted to the Asynchronicity of EECON 2107- Think Async: Embrace and Get Addicted to the Asynchronicity of EE
CON 2107- Think Async: Embrace and Get Addicted to the Asynchronicity of EE
 
BOF 2193 - How to work from home effectively
BOF 2193 - How to work from home effectivelyBOF 2193 - How to work from home effectively
BOF 2193 - How to work from home effectively
 
How to avoid top 10 security risks in Java EE applications and how to avoid them
How to avoid top 10 security risks in Java EE applications and how to avoid themHow to avoid top 10 security risks in Java EE applications and how to avoid them
How to avoid top 10 security risks in Java EE applications and how to avoid them
 
Java EE 7 overview
Java EE 7 overviewJava EE 7 overview
Java EE 7 overview
 
Confess 2013: OWASP Top 10 and Java EE security in practice
Confess 2013: OWASP Top 10 and Java EE security in practiceConfess 2013: OWASP Top 10 and Java EE security in practice
Confess 2013: OWASP Top 10 and Java EE security in practice
 
Utilize the Full Power of GlassFish Server and Java EE Security
Utilize the Full Power of GlassFish Server and Java EE SecurityUtilize the Full Power of GlassFish Server and Java EE Security
Utilize the Full Power of GlassFish Server and Java EE Security
 
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
 
Slides for the #JavaOne Session ID: CON11881
Slides for the #JavaOne Session ID: CON11881Slides for the #JavaOne Session ID: CON11881
Slides for the #JavaOne Session ID: CON11881
 
Security in java ee platform: what is included, what is missing
Security in java ee platform: what is included, what is missingSecurity in java ee platform: what is included, what is missing
Security in java ee platform: what is included, what is missing
 
An Overview of RUP methodology
An Overview of RUP methodologyAn Overview of RUP methodology
An Overview of RUP methodology
 
An overview of software development methodologies.
An overview of software development methodologies.An overview of software development methodologies.
An overview of software development methodologies.
 
NIO.2, the I/O API for the future
NIO.2, the I/O API for the futureNIO.2, the I/O API for the future
NIO.2, the I/O API for the future
 

Recently uploaded

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 

Recently uploaded (20)

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 

Real world RESTful service development problems and solutions

  • 1. Real-World RESTful Service Development Problems and Solutions Masoud Kalali @MasoudKalali
  • 2. Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  • 3. Speaker • Masoud Kalali • Works at ORACLE • Software engineer, author, blogger… • @MasoudKalali
  • 4. Program Agenda Introduction Request and Response…. A little bit of security Performance matters! More on Request and Response 1 2 3 4 5
  • 8. Flexible Request and Response - The problem • Produce multiple format of the representation – JSON – XML – HTML • Produce multiple variation of the representation – For privileged user compared to non privileged user – For older or newer client versions – For different type of clients Flexible response types
  • 9. Flexible Request and Response • Produce multiple representation of the same resource – Based on HTTP headers, accept and media-type (custom/standard) • List of standard media-types: http://www.iana.org/assignments/media-types/media-types.xhtml • Custom domain oriented media-types, e.g application/vnd.com.oracle.paas-service+json – Using URI pattern e.g: • http://api.domain.com/v1.1/customers/1/orders.xml • http://api.domain.com/v1.1/customers/1/orders.json – Agent driven • Client decide what representation to choose • Server sent different representations (300 or 406 status and required headers) – Combination of all Content Negotiation
  • 10. Flexible Request and Response – The solution • On the server side – @Produce • Should have matching media-type with request accept header • Non matching results in 406 - Not Acceptable – @Consume • Should have matching media-type with request content-type header • Non matching results in 415 - Unsupported Media Type • On the client side – Set correct content-type – Set expected accept header Content Negotiation: JAX-RS and flexible response types
  • 12. Resource Versioning: The Problem • Request and or response evolves to be incompatible – Some attributes are removed from request payload or required in the payload – Some attributes are added or removed or changed semantically in the response • Business semantic evolves to become incompatible – E.g the default is no longer set to be a small coffee cup – The provisioned service, in a PAAS environment, has caching included by default – Etc. How to evolve a resource?
  • 13. Resource Versioning: Solution alternative • Version added to resource (URI) (Facebook and Twitter) • /v1.1/resource/path/orders • /resource/path/orders?version=1.1 • Client is locked to the version • Easy to maintain in the server side • Requires all or none migration of the clients • Problems like linked resource address stored in client side… How to evolve a resource?
  • 14. Resource Versioning: Solution alternative • Version is negotiated as part of the request using accept header – Accept=application/vnd.com.oracle.paas.service-v1.1+json – Accept=application/vnd.com.oracle.paas.service-v2.1+json • Server code need to handle all supported previous versions – Same endpoint handling all versions and combination of them • Easy for clients to use what thy want • GitHub uses this format How to evolve a resource?
  • 15. Resource Versioning: Solution alternative • No versioning at all! – There is one interface that evolve every e.g 2 years • Clients must migrate to the new API • Old api will be shutdown – Easy to maintain – Easy to migrate • Hard to convince clients to migrate before the cut-off How to evolve a resource?
  • 17. Validating Request: Problem • When and how to validate the requests? – Are parameters in expected format – Is the payload Json as it is supposed to be? • When and how to verify the requests? – Are the parameters meaningful? E.g is there any order with that ID – Is the payload in expected JSON schema? Validation before action!
  • 18. Validating Request: Solution • Validation goes with versioning and content negotiation • Unified validation patterns across the codebase – Codified response format – Unified response body • Use annotations and standard validation as much as possible – Supports common media-types – Unified with custom coding/template being added Validation before action!
  • 20. Exception Handling • Please don’t send back stack trace – Use an ExceptionMapper as Provider as last line of cleanup! – Unless in development environment (with some considerations) • Codify all failures and include cause/action in the response – Use right http status code – Add application level code for codifying issues – Add human understandable message There are always unforeseen corner cases!
  • 21. More on Request/Response • Response status codes – There are more than 200, 404 and 500! • Unified response style – Predictability of response body – Application specific error code – Human readable message – cause/solution • debugability and traceability – debugified response – ECID – Unified Logging (Facebook Scribe, Google Dapper, Apache Kafka) How should a resource respond to a request?
  • 22. A little bit of security Authentication Access control Auditing
  • 23. Authentication • Authentication enabled for all resources • Happens before any other validation • Exclude the resource patterns that requires no authentication • No access without validating the authentication token Know who is requesting a resource
  • 24. Access control • Happens after detecting a valid authentication • Requests are easy to check – Unless column level checks are required, can be done in simple filter – Column level access control can be done using media types • Happens before any validation – unless params are being used as part of the access check • JAX-RS 2.1 is going to support declarative security Check who can access a resource
  • 25. Auditing/ Access logs • Keep a rich access log – Depending on the server you use • Include the usual who, when, what • Try using W3C Extended Log File Format if supported by server • Configure security realm for logging • Think ahead about incident detection/isolation, etc. Keep record of security incidents!
  • 27. Problem: Don’t hit the servers too often • Don’t reproduce the same response twice • Don’t use bandwidth whenever possible • Counter network reliability issues • Counter server downtimes Being stingy with the resource usage is OK!
  • 28. Solution: Caching • Local Cache • Proxy Cache • reverse-proxy (cache) • Server(Application) Level Cache Being stingy with the resource usage is OK!
  • 29. Caching • Use HTTP caching features • Client aware of provided caching support • Server evaluate caching related headers • intermediately hops • Types of Caching Headers – Absolute Caching Headers – Conditional Caching Headers Application Level Cache
  • 30. Caching • From Server side: – Cache-Control and directives – Last-Modified Absolute Caching HTTP/1.1 200 OK Content-Type: application/json Cache-Control: private, max-age=86400 Last-Modified: Mon, 08 Sep 2014 16:30:00 GMT • private • public • no-cache • no-store • max-age (overrides Expires) Cache Control Directives curl -v -X GET -H "If-Modified-Since:Mon, 08 Sep 2014 15:08:27 GMT" http://.../simple/1
  • 31. Caching • From client side send headers: – If-None-Match = "If-None-Match" ":" ( "*" | 1#entity-tag ) • At the server side produce headers: – Etag, when last-modified is hard to determine or not accurate enough Conditional
  • 32. Caching • Can be used for conflict resolution • Cache on GET request • Invalidate cache on PUT, POST or DELETE • Periodically purge cache entries • Cache invalidation, eviction is not deterministic • Give http://www.jboss.org/resteasy a try – Provides @Cache and @NoCache – Extension to JAX-RS More on Caching
  • 34. Problem: Wasting processing and bandwidth when updating • Updates are not usually full representation mutation • No need to process the whole representation to update one attribute • No need to re-persist the whole representation on change Only update what needs to be updated!
  • 35. Solution: Partial Updates & HTTP PATCH • Partial Updates with PUT • Partial Updates with POST • Partial updates with PATCH • JSON Patch is the future Only update what needs to be updated!
  • 36. Partial Updates & HTTP PATCH • Partially update a JSON document • Works with HTTP PATCH • Requires special body syntax and directives JavaScript Object Notation (JSON) Patch, RFC 6902 PATCH /coffee/orders/1234 HTTP/1.1 Host: api.foo.com Content-Length: 100 Content-Type: application/json-patch [ {“op”:"replace", ”path”: "/status", "value": "COMPLETED"} ]
  • 37. Partial Updates & HTTP PATCH • Supports six operations in the payload – op : can be “add”, “replace”, “move”, “remove”, “copy” or “test” • Another three attributes to describe the op – path: Location of the target attribute in the JSON document – value: The new value to be added or to replace another – from: (Only for move op) specifies the source location JavaScript Object Notation (JSON) Patch, RFC 6902
  • 38. Performance matters! Asynchronous And long running jobs in REST
  • 39. Problem: Serving more requests on the serverside • Fixed server side resources • Heavyweight container threads • Not keeping container resource longer than needed Don’t keep unnecessary resources for where not needed!
  • 40. Solution: Asynchronous And long running jobs in REST • On the serverside: – @Asynchronous: Annotate a sub-resource as Asynchronous – AsyncResponse: Provides results and actions on the running request • setting timeout • registering callbacks • resume, cancel suspended request processing • updating the response – @Suspended: To inject a suspended AsyncResponse into a sub-resource parameter Don’t keep unnecessary resources for where not needed!
  • 41. Asynchronous And long running jobs in REST • On the serverside: – CompletionCallback: Async response processing completion callback • Response processing completed and sent to client • Response processing failed with exception – ConnectionCallback: Client server connection events callback • Client is disconnected abruptly (before or during writing back the response) Server side callbacks
  • 42. Asynchronous And long running jobs in REST @GET @Produce(“application/json”) @Asynchronous public void getOrder(@Suspended AsyncResponse ar, String orderId) { final String result = prepareResponse(orderId); ar.resume(result) } Some small sample code Future<Coffee> future = client.target(“/coffees/orderId") .request() .async() .get(Coffee.class); try { Coffee coffee = future.get(30, TimeUnit.SECONDS); } catch (TimeoutException ex) { // } Client Code: Server Code: ** Alternative to Future is using InvocationCallback to get called when response is back
  • 44. Problem: Being perfect according to REST maturity model – Letting the resource graph describe itself – Describing the resource graph by name – Removing dependencies on fixed resource addresses – Letting clients have easier understanding of the API How to solve: { "order": "120" "links": [ {"rel": "self", "href":"http://api.dom.com/orders/120"}, {"rel": "cancel", "method":"delete", "href":"http://api.dom.com/orders/120"}, {"rel": "shippingDetails", method: "get", "href":"http://api.dom.com/orders/120/shipping"} ] }
  • 45. RESTful design maturity levels (Richardson Maturity Model) And the maturity model Level 0: XML RPC/Remoting – One resource and one verb (POST) for everything! Level 1: Multiple resources, not correct use of verbs Level 2- Proper use of HTTP verbs Level 3- HATEOAS – Resource graph discovery MaturityGrowth
  • 46. HATEOAS • REST maturity model – The glory comes when you are at HATEOAS level! • Why to` use HATEOAS – Describe the resource graph by name – Remove dependencies on fixed resource addresses – Let the resource graph describe itself – Let clients have easier understanding of the API • When to use HATEOAS – When one resource has some dependent resources – What is allowed and what is not (logic) – What is accessible to a user and what is not (security) Let the resource graph describe itself
  • 47. JAX-RS and HATEOAS • No standard API so far but the following to the rescue – Link – UriInfo – UriBuilder • JAX-RS extensions and Jeresy specific APIs – Use https://code.google.com/p/jax-rs-hateoas/ extension – Use Jeresy specific API • Use Spring MVC • Use RESTeasy • It is not end of the world if you don’t! Java/EE HATEOAS support out of the box
  • 49. Localizations and Internationalization • One time used messages (not persisted for retrieval) – Decide the locale using accept-language header – Produce the right locale representation • Messages would be used by multiple times(persisted messages) – Codify every text and set of argument – Let a last layer filter decide how to process the message code and formatting params – Let the last layer filter decide what to be the date format and , currency should be – Let the last layer filter rewrite the response replacing the templates – Keep every message in a memory cache Different locale getting the right format and style of messages
  • 50. Few more topics Usage Throttling
  • 51. Problem: Abusing the API, categorizing the users – Better resource allocation and management – Prevent and handle abuse – Provide better support for premium users Keep tap on how many request one user can send!
  • 52. Solution: Resource Throttling • Why use Rate Limiting? – Prevent and handle abuse – Provide better support for premium users • How Rate Limiting works? – Servlet filter sits in front – User user tokens or IP addresses as identifiers – Use in-memory cache for book keeping – Prevents requests reaching endpoints when limit reached – Reset/update cached counters when needed Keep tap on how many request one user can send!
  • 53. Throttling Patterns • Response status, headers – HTTP 429 Too Many Requests error code – Retry-After header – X-RateLimit-Limit: ### – X-RateLimit-Remaining: ### – X-RateLimit-Reset: EPOCH_SECONDS • Descriptive response in the requested media type Headers and response
  • 54. Throttling Patterns • Client side – Use caching – keep tap on number of requests – Pay attention to headers – No brainless loops (polling) • Server side – Support caching (etags and max-age) – provide streaming endpoints when possible (feeds, news, public data) Best practices
  • 55. Few more topics REST and plug-ability and extensibility
  • 56. MicroServices… • Same good old modularity with with distributed interfaces • Plus with communication over HTTP, mostly! • Plus communication using message passing (services, events, event bus) • Plus with independent SLDC • Plus being on different platforms/use different data-store/etc. – Whatever tools, language, framework that fits better! How far?
  • 57. MicroServices • Advantages – Simplicity of development and maintenance – Isolation of requirements and fulfillments – Scale-up and Scale-down, scale-out and scale-in – More focused HR managements – Etc. • Disadvantages – Operations Overhead – High level of DevOps, RE Skills Required – Complexities of a Distributed System – Etc. Pros and Cons
  • 59. • http://tools.ietf.org/html/rfc6902 • http://tools.ietf.org/html/rfc6901 • http://resteasy.jboss.org/ • https://jersey.java.net/documentation/latest/ • http://tools.ietf.org/html/rfc6585 • http://tools.ietf.org/html/rfc5789 • http://martinfowler.com/articles/richardsonMaturityModel.html • http://www.slideshare.net/bhaktiks/real-world-restful-service-development-problems-and- solutions • CCL photos used in slides: • https://www.flickr.com/photos/treehouse1977/2892417805/ • https://www.flickr.com/photos/treehouse1977/2892417805/ • https://www.flickr.com/photos/essjay/165928100/ • https://www.flickr.com/photos/jforth/4413370462/ • https://www.flickr.com/photos/sakalak/8737872379/ • https://www.flickr.com/photos/jbparrott/8980026600 • https://www.flickr.com/photos/pentadact/36593493/ • https://www.flickr.com/photos/jasohill/4442279347/ • https://www.flickr.com/photos/mdsharpe/5075953655 • https://www.flickr.com/photos/chuqvr/8329512894/ • https://www.flickr.com/photos/longo/2684733921 • https://www.flickr.com/photos/_davor/14757399908 Resources

Editor's Notes

  1. This slide can also be used as a Q and A slide
  2. This slide can also be used as a Q and A slide
  3. This slide can also be used as a Q and A slide
  4. Explain which industry is more suited to use which schema
  5. Explain which industry is more suited to use which schema
  6. Explain which industry is more suited to use which schema
  7. Explain which industry is more suited to use which schema
  8. This slide can also be used as a Q and A slide
  9. This slide can also be used as a Q and A slide
  10. This slide can also be used as a Q and A slide
  11. This slide can also be used as a Q and A slide
  12. 304
  13. This slide can also be used as a Q and A slide
  14. This slide can also be used as a Q and A slide
  15. This slide can also be used as a Q and A slide
  16. This slide can also be used as a Q and A slide
  17. This slide can also be used as a Q and A slide
  18. This slide can also be used as a Q and A slide