# Fabric

The Grey Matter Mesh is built out of a number of logical abstractions. The following table describes the logical abstractions, or objects, that make up the Grey Matter Mesh. The arrangement, connections, and configuration of these objects define the mesh and its behaviors.

![](https://3431003532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsNFVozLgvw3NDMzxBg-1847203797%2Fuploads%2Fgit-blob-90ad6cf2b4be144583a32b28c2feaa77acbd6bee%2Ffabric-cli-control-flow.png?alt=media)

* [cluster](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/cluster)
* [domain](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/domain)
* [listener](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/listener)
* [proxy](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/proxy)
* [route](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/route)
* [shared\_rules](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/shared_rules)
* [zone](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/zone)

## Summary

| Object Name   | Description                                                                                                                                                            | Links To               | Links From                                             |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | ------------------------------------------------------ |
| zone          | A logically isolated region of the mesh. Zones are the highest level of organizational infrastructure. Zones contain all other objects.                                |                        | cluster, domain, listener, proxy, route, shared\_rules |
| domain        | The URL domains for which routes and clusters will be assigned within a proxy. E.g. `www.deciphernow.com`, `localhost`, or `*`                                         | zone                   | listener, proxy, route                                 |
| listener      | The Envoy listener object that defines the host, port, and protocol for a proxy within the mesh.                                                                       | zone, domain           | proxy                                                  |
| proxy         | The Proxy object represents the aggregate objects that get mapped to each instance of the Grey Matter Proxy.                                                           | zone, domain, listener |                                                        |
| route         | A Route defines how a URL in a given domain is handled. Route objects directly affect URI path matching, prefix rewriting, and redirects.                              | zone, domain           | shared\_rules                                          |
| shared\_rules | Shared\_rules define how requests are sent to clusters. They can perform traffic splitting and shadowing.                                                              | zone                   | route                                                  |
| cluster       | Clusters represent collections of either hard-coded or discovered instances of a microservice. Clusters handle health checks, circuit breaking, and outlier detection. | zone                   | shared\_rules                                          |

![](https://3431003532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsNFVozLgvw3NDMzxBg-1847203797%2Fuploads%2Fgit-blob-6f4b295eba3f03bf629da54b6f37442731070c20%2FFabric-Mesh-Objects-ERD.png?alt=media)

## Detailed Descriptions

* [Zone](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/zone)
* [Listener](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/listener)
* [Proxy](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/proxy)
* [Domain](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/domain)
* [Route](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/route)
* [Shared Rules](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/shared_rules)
* [Cluster](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/cluster)

## Request Flow

1. **Listener**: A request from inside or outside the mesh is first sent to the host:port of a `listener`.
2. **Domain**: The request host:port is matched against the available domains, and redirected if need be, and sent to an attached set of `routes`.
3. **Route**: The request URI path portion is then passed through the `route` object for matching, rewriting, and redirecting to a `shared_rule`.
4. **Shared Rule**: The request is passed through the `shared_rules` to send, split, or shadow traffic to clusters.
5. **Cluster**: A `cluster` sends the final request to one of its available instances, retrying and breaking connections as necessary.

![](https://3431003532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsNFVozLgvw3NDMzxBg-1847203797%2Fuploads%2Fgit-blob-dbc6cdacfd8c8e6f14486fc1cd577295d675de95%2Fflowchart.png?alt=media)

## Nested Objects

Each API Objects discussed above is made up of individual fields and nested structures. Some structures are unique to a given object, but some are re-used across multiple places. These are discussed below.

* [constraint](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/domain/header_constraint)
* [match](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/route/match)
* [response\_data](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/route/response_data)
* [rule](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/route/rule)
