Api break too manyu

why api get get get many?

ex. get docus, get meta, get labels. not 1 get all?

is bad feature and bad design not use.

This a portion of an internal presentation regarding our API design philosophies:

Due to its modular design, the API is an inside-outside style one. The API follows the structure of the data models. Since data is spread over different models it is not possible to create inclusive data responses.

Mayan’s API approach is the same any large API design, like Google Cloud’s.

A single API can’t be a solution for every problem.


Mayan’s unique batch request API system was created to provide a middle point between inside-out design and outside-in needs.

However if not properly understood, the batch request API can be easily misused or abused. It is not to be used as a substitute of a database query.

If the API or batch request API can’t solve a user need optimally, then create a custom API via a
custom app. Create custom API via custom API for outside-in needs that mirror a database query for your specific need. Creating custom API endpoints is easy and a design feature. APIs in Mayan are themselves services, just look at any app in Mayan to learn how to register your own API endpoints.

There are also performance implications. Serialization is an expensive operation, the more data the more resources and the more delay in getting the response back from the API. This is specially true for related fields. In these cases use the field limitation feature of Mayan to reduce the serialization burden.

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.