REST API design -- resource modeling

Click for: original source

In this older article by Prakash Subramaniam from ThoughtWorks looks at the REST API design best practices. The key abstraction of information in REST is a resource. A resource is a conceptual mapping to a set of entities, not the entity that corresponds to the mapping at any particular point in time.

Resources form the nucleus of any REST API design. Resource identifiers (URI), Resource representations, API operations (using various HTTP methods), etc. are all built around the concept of Resources.

The starting point in selection of resources is to analyze your business domain and extract the nouns that are relevant to your business needs

The article then depicts and explains in detail some important design choices for REST API:

  • Fine grained CRUD resources versus Coarse Grained resources
  • Preventing migration of business logic to API consumer
  • Coarse grained aggregate resources for business processes
  • Nouns versus Verbs
  • Reification of abstract concept
  • REST without PUT and CQRS

… and much more. Very in depth and informative article. Excellent read!

[Read More]

Tags restful apis web-development json