REST Design Concerns
- 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的更多相关文章
- Running Kafka At Scale
https://engineering.linkedin.com/kafka/running-kafka-scale If data is the lifeblood of high technolo ...
- Singleton Summary
Java Singleton: Singleton pattern restricts the instantiation of a class and ensures that only one i ...
- Design Patterns Simplified - Part 2 (Singleton)【设计模式简述--第二部分(单例模式)】
原文链接: http://www.c-sharpcorner.com/UploadFile/19b1bd/design-patterns-simplified-part-2-singleton/ De ...
- [转]Design Pattern Interview Questions - Part 4
Bridge Pattern, Composite Pattern, Decorator Pattern, Facade Pattern, COR Pattern, Proxy Pattern, te ...
- Cloud Design Patterns Book Reading(undone)
目录 . the most common problem areas in cloud application development ) Availability ) Data Management ...
- Domain Driven Design and Development In Practice--转载
原文地址:http://www.infoq.com/articles/ddd-in-practice Background Domain Driven Design (DDD) is about ma ...
- 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 ...
- Domain Driven Design
在Spring官网的第一个tutorial中看到了这种 设计模式 Domain Driven Design 找到了篇介绍这个得文章: What is Domain Driven Design? &qu ...
- BookNote: Refactoring - Improving the Design of Existing Code
BookNote: Refactoring - Improving the Design of Existing Code From "Refactoring - Improving the ...
随机推荐
- 7 个基本的 JS 函数【译】
本文由 伯乐在线 - 刘健超-J.c 翻译,进林 校稿.未经许可,禁止转载!英文出处:davidwalsh.name.欢迎加入翻译组. 我记得早期的 JavaScript ,要完成任何事情几乎都绕不开 ...
- Jersey(1.19.1) - Building URIs
A very important aspects of REST is hyperlinks, URIs, in representations that clients can use to tra ...
- Ehcache(2.9.x) - API Developer Guide, Cache Eviction Algorithms
About Cache Eviction Algorithms A cache eviction algorithm is a way of deciding which element to evi ...
- hdoj1423 最长上升公共子序列
hdoj1423 题目分析: 两个数组a[n1] , b[n2], 求最长上升公共子序列. 我们可用一维存储 f[i] 表示 b 数组以 j 结尾, 与 a[] 数组构成的最长公共上升子序列. 对数组 ...
- ubuntu(16.04.01)学习-day2
1.建立硬链接: ln main.c mainsoft 2.建立软链接:ln -s main.c soft 3.对文档进行统计 wc main.c返回行.单词数和字符数 4.查看相应命令的描述 wha ...
- popViewControllerAnimated 后,对页面内UITableView 内数据刷新
popViewControllerAnimated后,这时它不执行viewDidLoad,所以不能及时对viewControler及时刷新,此时对该页面进行操作可以调用viewWillAppear:( ...
- YSPASYS 中小型企业简单员工评价考核系统
背景:公司运营接近2年时间了,随着不断的有员工入职.离职,使用信息化管理员工各类信息是一件很有必要的事儿.诸如员工基本信息,内部公告,资产盘点,客户管理,工作周报,优秀员工评选,请假.外出.报销.采购 ...
- Query 快速入门教程
Query 快速入门教程 http://www.365mini.com/page/jquery-quickstart.htm#what_is_jquery jquery常用方法及使用示例汇总 http ...
- jQuery-ui treegird 使用
在实际应用中可能会碰到不同的需求,比如会根据每行不同的参数或属性设置来设置同列不同的editor类型,这时原有的例子就显的有点太过简单,不能实现我们的需求,现在应用我在项目中的操作为例,显示下实现同列 ...
- dao层实现类的常见写法
记录下一个dao层类的写法,方便以后的使用. package com.bupt.auth.dao.impl; import java.util.ArrayList; import java.util. ...