• Less Requests, More data; one of the core RESTful API design paradigms is the concept of less API requests should be made with less data yielding larger more complete responses. The cost associated to a transaction is defined primarily by the transport layer data and not the payload of a request, thus less is more.
    • To this extent, when performing a PUT on a resource, it is in the best interest of the API to allow edits for all editable properties. This will allow a Consumer to keep costs lower when they need to edit a MMY AND a VIN for instance.
  • Idempotence; This term has caused the most confusion. A core Software Design and critical API concept an API call is considered idempotent if subsequent calls of that API yield the same results and the same state for that resource. 
    • For a proper REST API design, GET and POST requests can never be idempotent, PUT and DELETE requests should always be idempotent
    • Enforcing Idempotence for PUTs and DELETEs ensures a consumer knows what they are going to get always. No assumptions need to be made about the resultant resources state and the Consumer can call the method confident that what they gave is what the entity is.
  • Multi-Consumer API Solutions cannot enforce an accurate state representation of a resource without enforcing Idempotency. Simply put, state of a resource is not what a consumer expects it to be without Idempotency.
  • Limiting Network based Transient Faults; When a Consumer experiences a network connection issue, or a component within the Connected Car solution experiences network connection issues while a PUT or DELETE is being processed, the Consumer will receive either a 400 or 500 series error. That resource is now considered Transient and confidence the Entity has been modified is non-existent
    • Even with the most solid design High Available system, a network based transient fault is not just possible, but inevitable.
    • Enforcing Idempotency on our PUTs and DELETEs will allow a Consumer to simply retry the request knowing that the resultant resource is exactly what they wanted, regardless of the previous API call's state.
  • Data Synchronization and REST Resource Accessibility; A REST API is more in tune with a Check-out/Check-in model than it is to an RPC API model.
    • A Consumer is expected to maintain a synchronized data model via GET requests & Synchronization Task Calls (Multi Vehicle Search and Account Synchronization for example) before performing a subsequent modification. AKA Check-Out that resource, modify that resource and Check it In.
    • In RPC, the inverse is expected, a Consumer would submit what they would like the model to be and the API will tell the Consumer what the resultant resource will be.
    • The latter model removes control from the Consumer and can limit their ability to accurately consume the APIs resource. Simply put, the consumer may never truly know what the resource will be until AFTER the modification has been made and committed.
    • In addition, the former model creates a more performant API. The responsibilities are levied on the Consumer as opposed to the API, thus reducing impacts to other consumers, reducing processing time and simplifying the APIs business logic. For Connected Car, this can be considered a priority.

REST Design Concerns的更多相关文章

  1. Running Kafka At Scale

    https://engineering.linkedin.com/kafka/running-kafka-scale If data is the lifeblood of high technolo ...

  2. Singleton Summary

    Java Singleton: Singleton pattern restricts the instantiation of a class and ensures that only one i ...

  3. Design Patterns Simplified - Part 2 (Singleton)【设计模式简述--第二部分(单例模式)】

    原文链接: http://www.c-sharpcorner.com/UploadFile/19b1bd/design-patterns-simplified-part-2-singleton/ De ...

  4. [转]Design Pattern Interview Questions - Part 4

    Bridge Pattern, Composite Pattern, Decorator Pattern, Facade Pattern, COR Pattern, Proxy Pattern, te ...

  5. Cloud Design Patterns Book Reading(undone)

    目录 . the most common problem areas in cloud application development ) Availability ) Data Management ...

  6. Domain Driven Design and Development In Practice--转载

    原文地址:http://www.infoq.com/articles/ddd-in-practice Background Domain Driven Design (DDD) is about ma ...

  7. Understanding Design And Development Job Titles--reference

    If you’re confused about the difference between a front-end developer and a web designer, you’re not ...

  8. Domain Driven Design

    在Spring官网的第一个tutorial中看到了这种 设计模式 Domain Driven Design 找到了篇介绍这个得文章: What is Domain Driven Design? &qu ...

  9. BookNote: Refactoring - Improving the Design of Existing Code

    BookNote: Refactoring - Improving the Design of Existing Code From "Refactoring - Improving the ...

随机推荐

  1. Jersey(1.19.1) - Extracting Request Parameters

    Parameters of a resource method may be annotated with parameter-based annotations to extract informa ...

  2. Unity3D鼠标点击物体产生事件

    如果需要处理鼠标点击物体的情况, 可以当数据接触物体时,鼠标手势改变,然后点击后和NPC产生对话等: using UnityEngine; using System.Collections; publ ...

  3. Memcached学习(三)

    通过Java客户端实现与Memcached的交互,Java客户端的实现了使用了开源的Memcached-Java-Client,开源地址在GitHub上. 如下是通过该开源库实现的Memcached交 ...

  4. 169. Majority Element My Submissions Question

    Total Accepted: 95925 Total Submissions: 239241 Difficulty: Easy Given an array of size n, find the ...

  5. SVN之文件同步更新

    在SVN的实际使用上,我有这样的一个需求,同一份保存在SVN库的文件,要求取出在不同的地方,并且仍然要保持同步.根据这样的需求,可以具体分为以下两种情况,下面以库文件A,副本文件A1和副本文件A2,来 ...

  6. xamarin android——数据绑定到控件(一)

    mono for android 中光标由ICursor 接口标识,该接口公开了操作结果数据集的所有方法.光标的使用非常消耗系统资源,所以不使用时应该光比光标.可以通过StartManagingCur ...

  7. MySQL学习笔记之数据存储类型

    说明:本文是作者对MySQL数据库数据存储类型的小小总结. Numeric Type (数字类型) 1.TINYINT.SMALLINT.MEDIUMINT.INT.BIGINT主要根据存储字节长度不 ...

  8. VM 打开虚拟机时报“内部错误”

    VM 打开虚拟机时报“内部错误” 你是直接双击VM软件吗? 试下右键用管理员身份打开VM吧 是不是成功了 不成功不要找我,我就是这样成功的,就自己记录下

  9. 新贵HTML5,2016的发展方向会怎样?

    2014年下半年,微信捧火了HTML5小游戏,自此国内各行各业开始对HTML5保持高涨关注.2015年是国内HTML5行业迅速发展的一年,在媒体大肆渲染“互联网寒冬”之际,HTML5作品的生产数量和传 ...

  10. AngularJS(7)-表格

    ng-repeat 指令可以完美的显示表格. <!DOCTYPE html> <html lang="en"> <head> <meta ...