Open kinlane opened 3 years ago
Repository Organization in Microcks stands for the way you classify the API & Services of the repository of a Microcks instance. But the first thing to consider may be : how many Microcks instance may you have in your organization?
From field feedback, we’ve seen different approaches following those patterns :
The « one Microcks per developer on her laptop » is also a pattern we saw but that is much more transitional before actually deploying distributed or central instances.
Microcks has specific features for managing these different patterns :
labels
can be set to the different APIs of an instance in order to let users map repository structure on their own classifications needs. This labels can be used to set domain
, status
, type
, pattern
, team
, application
or whatever. See Organizing repository | Microcks.iomaster
label in order to have fine-grained permissions on the different APIs of a big repository. See RBAC Segmentation | Microcks.ioAs you see, labels
are a very important point in Microcks repository organization - they have the same role than in Kubernetes. But how can you set labels to an API? There are different ways of doing this:
labels
into your OpenAPI or AsyncAPI specs. See OpenAPI usage for Microcks | Microcks.io for example,APIMetadata
artifact. When it’s not possible / desirable to use spec extensions, you can use this-specific artifact - aside your main spec in your Git repository for example and import it into Microcks. See Microcks API | Microcks.ioThe last topic I foresee about repository organization in the Microcks context is the question of the Git repository holding the API artifacts organization.
Form the field, we’ve seen many different things - depending on the human organization and its maturity regarding domain driven design most of the time. However, there’s this particular organization that is described below and that I tend to promote:
https://git.acme.com/<domain_1>
/apis | products
/sub-domain
myapi-openapi-v1.0.yaml
myapi-apimetadata-v1.0.yaml
myapi-collection-tck-v1.0.json
myevent-asyncapi-v1.0.yaml
/app_1 | microservice_1
/src/main
/java
/resources
myapi-openapi-v1.0.yaml
/tests
myapi-collection-dataset-v1.0.json
/staging
/app_1 | microservice_1
myapi-collection-ua-dataset-v1.0.json
myapi-collection-perf-dataset-v1.0.json
Some explanations:
The top level here is a Git organization corresponding to the domain
- or the organisation unit level or the urbanisation unit level you have decided to set the IS break-ability level upon),
Within this top level lies a dedicated repository for all the things related to the description of business capabilities this domain brings to the organization. That’s where live the products
of the domain and so the API definitions
. They may be organized by sub-domains for large ones and you may find OpenAPI / AsyncAPI specifications as well as Microcks APIMetadata defining the ownership or some behavioral refinements. You’d probably add to this some Postman Collection holding documentation or tests playing the role of TCK (Test Certification Kit) for future implementations of APIs.
You’ll also find within this domain
, many repositories related to applications | microservices | functions | implementations components
related to this domain. This is where the code lives and these components will need resources references to the specification they’re implementing (maybe for code skeleton generation purposes). I think its also a best practice to have these components managing their Postman Collection for specifying additional examples dataset.
Finally there’s usually this need to manage additional datasets for specific simulation or testing needs during the staging
process. Postman Collection are perfectly suited for that purpose. Hence we may find specific collection for specific app or microservices that may be used within ephemeral Microcks instances as explained above.
I would like to create an API blueprint for how repositories should be organized, publish it as a formal blueprint at APIs.How, and use to tell a story about this level of organization within API operations.