GOOD API AUTONOMOUS SERVICE DISCOVERY “Get me a service that knows weather in Paris.” “Get me a service that can fulfill the parcel logistics of 6 pallets from Prague to Paris.” “Get me a service that can play every movies by the director of movie Avatar.”
GOOD API HOW TO ACHIEVE CONSISTENT INTERFACE • SOAP (Tunneling architectural style) • REST (Hypermedia architectural style) • Query Languages (Tunneling architectural styles) • Proprietary function libraries (RPC architectural style) • Domain-specific standards (on top of a respective style)
GOOD API SOAP • Uniform Interface is not part of SOAP • Added on the application level of service qualities • Security: WS-Security/SecureConversation/Trust • Transactions: WS-AtomicTransaction and WS-BusinessActivity
GOOD API HATEOAS 1. All application state is kept on the client side. Changes to application state are the client’s responsibility 2. The client can only change its application state by making an HTTP request and processing the response. 3. How does the client know which requests it can make next? By looking at the hypermedia controls in the representations it’s received so far. 4. Therefore, hypermedia controls are the driving force behind changes in application state. Credit: RESTful Web APIs by Richardson & Amundsen
GOOD API REST ARCHITECTURAL STYLE • Great in theory • In reality very few follows the UI constraints, making the interfaces incompatible • Workarounds possible via explicit standards & governance e.g. Oracle+Apiary API Style Guide
GOOD API NO VERSIONING “GraphQL takes a strong opinion on avoiding versioning by providing the tools for the continuous evolution of a GraphQL schema.” http://graphql.org/learn/best-practices/
GOOD API GraphQL GraphQL out of the box provides Uniform Interface and thus results in systems with: 1. Simplified Architecture 2. Increased Components Visibility 3. Decoupled Components
GOOD API GOOD API In fact, GraphQL is so good at providing UI, I wanted to take it and create the easiest way for everybody to get to the uniform interface…