You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/specifications/providers.md
+35-29Lines changed: 35 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -17,11 +17,15 @@ This document outlines their behavior and configuration.
17
17
18
18
Consistent with our [naming conventions](../naming.md), the flagd provider name (no matter what language or runtime is in use) is `flagd`.
19
19
20
-
## In-Process vs RPC Evaluation
20
+
## Overview of Resolver Types
21
21
22
-
There are two modes of operation (`resolvers`) for flagd providers; _in-process_ and _RPC_.
23
-
Both modes have their advantages and disadvantages.
24
-
For more information on the architectural implications of these different modes, see the [RPC vs In-Process Evaluation](../../architecture.md#rpc-vs-in-process-evaluation) page.
22
+
There are three resolver types for flagd providers:
23
+
24
+
- RPC Resolver: Evaluates flags remotely by connecting to a flagd instance using the gRPC evaluation protocol.
25
+
- In-Process Resolver: Downloads the flag set rules from a flagd instance and evaluates them locally, offering low-latency performance.
26
+
- File Resolver: Operates offline by reading flag definitions from a file, ideal for environments without network connectivity.
27
+
28
+
Each resolver type has unique characteristics and use cases. Below, we delve into their specifics.
25
29
26
30
## flagd Provider Lifecycle
27
31
@@ -117,7 +121,7 @@ While the provider is in state `STALE` the provider resolves values from its cac
117
121
When the time since the last disconnect first exceeds `retryGracePeriod`, the provider emits `ERROR`.
118
122
The provider attempts to reconnect indefinitely, with a maximum interval of `retryBackoffMaxMs`.
119
123
120
-
## RPC Evaluation
124
+
## RPC Resolver
121
125
122
126
RPC providers use the [evaluation protocol](./protos.md#flagdevaluationv1evaluationproto) to connect to flagd, initiate the [event stream](./protos.md#eventstreamresponse), listen for changes in the flag definitions, and evaluate flags remotely by calling flagd.
123
127
RPC providers are relatively simple to implement since they essentially call a remote flagd instance with relevant parameters, and then flagd responds with the resolved flag value.
@@ -188,7 +192,7 @@ This pattern is consistent with OpenFeature's [static context paradigm](https://
188
192
189
193
The provider metadata includes properties returned from the [provider_ready event payload](./protos.md#eventstreamresponse) data.
190
194
191
-
## In-Process Evaluation
195
+
## In-Process Resolver
192
196
193
197
In-process providers use the [sync schema](./protos.md#syncflagsresponse) to connect to flagd, initiate the [sync stream](./protos.md#eventstreamresponse), and download the `flag set` rules to evaluate them locally.
194
198
In-process providers are relatively complex (compared to RPC providers) to implement since they essentially must implement more of flagd's logic to evaluate flags locally.
@@ -237,11 +241,13 @@ If only a subset of the sync-metadata response is desired to be injected into th
237
241
238
242
The provider metadata includes the top-level metadata properties in the [flag definition](../flag-definitions.md).
239
243
240
-
### Offline (File) Mode
244
+
##File Resolver (Offline Mode)
241
245
242
246
The in-process resolver mode can also use a file based [flag definition](../flag-definitions.md).
243
247
This does not connect to a flagd instance or gRPC sync implementation, and instead polls a flag definition from a file.
244
-
If the file has been modified since the last poll (based on the file metadata) and [flags have changed](#changed-flags), a `PROVIDER_CONFIGURATION_CHANGED` event with the appropriate `changed flags` field is emitted.
248
+
If the file has been modified since the last poll (based on the file metadata) and [flags have changed](#changed-flags), a `PROVIDER_CONFIGURATION_CHANGED` event with the appropriate `changed flags` field is emitted.
249
+
250
+
The Evaluation uses [JsonLogic](#jsonlogic-evaluation) and [custom JsonLogic evaluators](#custom-jsonlogic-evaluators) like the [InProcess Resolver](#in-process-resolver).
245
251
246
252
!!! note
247
253
@@ -256,27 +262,27 @@ precedence.
256
262
257
263
Below are the supported configuration parameters (note that not all apply to both resolver modes):
258
264
259
-
| Option name | Environment variable name | Explanation | Type & Values | Default | Compatible resolver |
0 commit comments