Components

    Dapr uses a modular design where functionality is delivered as a component. Each component has an interface definition. All of the components are pluggable so that you can swap out one component with the same interface for another. The components contrib repository is where you can contribute implementations for the component interfaces and extend Dapr’s capabilities.

    A building block can use any combination of components. For example the building block and the state management building block both use . As another example, the pub/sub building block uses .

    You can get a list of current components available in the hosting environment using the CLI command.

    Each component has a specification (or spec) that it conforms to. Components are configured at design-time with a YAML file which is stored in either a folder within your solution, or globally in the folder created when invoking . These YAML files adhere to the generic Dapr component schema, but each is specific to the component specification.

    Available component types

    The following are the component types provided by Dapr:

    State store components are data stores (databases, files, memory) that store key-value pairs as part of the state management building block.

    Name resolution

    Name resolution components are used with the service invocation building block to integrate with the hosting environment and provide service-to-service discovery. For example, the Kubernetes name resolution component integrates with the Kubernetes DNS service, self-hosted uses mDNS and clusters of VMs can use the Consul name resolution component.

    Pub/sub broker components are message brokers that can pass messages to/from services as part of the building block.

    Bindings

    A secret is any piece of private information that you want to guard against unwanted access. Secrets stores are used to store secrets that can be retrieved and used in applications.

    Configuration stores

    Configuration stores are used to save application data, which can then be read by application instances on startup or notified of when changes occur. This allows for dynamic configuration.

    Dapr allows custom middleware to be plugged into the HTTP request processing pipeline. Middleware can perform additional actions on an HTTP request, such as authentication, encryption and message transformation before the request is routed to the user code, or before the response is returned to the client. The middleware components are used with the building block.