What is granularity in API?

What is granularity in API?

Granularity is the extent to which an API divides information among individual resources. With a fine-grained API, a consumer might have to make multiple, highly-specific requests to different endpoints in order to get the same amount of information as they would from a single call to a coarse-grained API.

How do I plan a RESTful API?

RESTful API Design — Step By Step Guide

  1. Jeff Bezos’ (Key to Success) Mandate. Some of you might have been already aware of Jeff Bezos’ mandate to the developers in Amazon.
  2. Keep it simple. Souce — Internet.
  3. Use nouns and NOT the verbs.
  4. Use of right HTTP methods.
  5. Use Plurals.
  6. Use parameters.
  7. Use proper HTTP codes.
  8. Versioning.

What is the difference between coarse and fine grained?

A coarse-grained description of a system regards large subcomponents. A fine-grained description regards smaller components of which the larger ones are composed.

What is very fine level parallelism?

In fine-grained parallelism, a program is broken down to a large number of small tasks. These tasks are assigned individually to many processors. The amount of work associated with a parallel task is low and the work is evenly distributed among the processors. Hence, fine-grained parallelism facilitates load balancing.

How to choose your RESTful service granularity?

This article discusses a few points on how API designers would need to choose their RESTful service granularity levels. Join the DZone community and get the full member experience. Granularity is an essential principle of REST API design.

How is granular should you design APIs?

One of the many things to take into account when building a great API is granularity. For more experienced developers, the concept of granularity is a given, but it may be a confusing concept for programmers new to API development.

Which is an essential principle of REST API design?

Granularity is an essential principle of REST API design. As we understand, business functions divided into many small actions are fine-grained, and business functions divided into large operations are coarse-grained.

How to decide the granularity of a request?

Maintain a balance between the amount of response data and the number of resources required to provide that data. It will help decide the granularity. The types of performed operations on the data should also be considered as part of the design when defining the granularity. Read requests are normally coarse-grained.