ApiDesign
Last updated
Was this helpful?
Last updated
Was this helpful?
Send on the left; Receive on the right
Marshal/Unmarshal
Challenges: For a remote procedure call, a remote machine may:
Different sizes of integers and other types
Different byte ordering. E.g. Big endian / little endian
Different floating point representations
Different character sets
Different alignment requirements
How to define the grammer for remote operations. E.g. How to represent an add operation? Use '+', 'add' or number '1'
How to represent the parameters for functions. E.g. Polish notation, reverse polish notation.
Challenges: Reference variables
What we pass is the value of the pointer, instead of the pointer itself. A local pointer, pointing to this value is created on the server side (Copy-in). When the server procedure returns, the modified 'value' is returned, and is copied back to the address from where it was taken (Copy-out).
This approach is not foolproof. The procedure 'myfunction()' resides on the server machine. If the program executes on a single machine then we must expect the output to be '4'. But when run in the client-server model we get '3'. Why ? Because 'x, and 'y' point to different memory locations with the same value. Each then increments its own copy and the incremented value is returned. Thus '3' is passed back and not '4'.
Service discovery
How to do service discovery. E.g. What functionalities a remote service support.
Performance and resiliency
What to do when faced with performance and resiliency conditions, etc.
NFC protocol mount (put a remote directory on a local path) and nfsd (read / write files) commands.
SUN RPC flowchart
XDR means external data representation.
Utilities for generating stub
Service discovery with portmapper
Error prone compression and decompression process.
Hard to modify the protocol.
ONC RPC is function oriented, not object oriented.
It has the following benefits:
ONC RPC is binary based. XML allows client and server accepted data transformation to have some inconsisteny. e.g. changing the order of elements will not result in any error.
It is object oriented instead of function oriented.
WSDL protocol
WSDL protocol could be used to generate client's stub.
UDDI
Universal description, discovery and integration
Sample request
GraphQL at Netflix:
Embracing the Differences : Inside the Netflix API Redesign
Redesign the Netflix API:
API migration at Netflix:
Geektime [Chinese]:
Resiliency
Open API spec:
Google API:
Handyman API guidance:
The Design of Web APIs:
API design patterns:
API security in action:
API design guidance: