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: openfeature-provider/java/README.md
+44-5Lines changed: 44 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,8 @@ Configure the provider behavior using environment variables:
121
121
122
122
-`CONFIDENCE_RESOLVER_POLL_INTERVAL_SECONDS`: How often to poll Confidence to get updates (default: `30` seconds)
123
123
-`CONFIDENCE_NUMBER_OF_WASM_INSTANCES`: How many WASM instances to create (this defaults to `Runtime.getRuntime().availableProcessors()` and will affect the performance of the provider)
124
+
-`CONFIDENCE_MATERIALIZATION_READ_TIMEOUT_SECONDS`: Timeout for materialization read operations when using remote materialization store (default: `2` seconds)
125
+
-`CONFIDENCE_MATERIALIZATION_WRITE_TIMEOUT_SECONDS`: Timeout for materialization write operations when using remote materialization store (default: `5` seconds)
124
126
125
127
##### Deprecated in favour of a custom ChannelFactory:
126
128
-`CONFIDENCE_DOMAIN`: Override the default Confidence service endpoint (default: `edge-grpc.spotify.com`)
@@ -161,17 +163,54 @@ The provider supports **materializations** for two key use cases:
161
163
162
164
1.**Custom Targeting via Materialized Segments**: Efficiently target precomputed sets of identifiers from datasets. Instead of evaluating complex targeting rules at runtime, materializations allow for fast lookups of whether a unit (user, session, etc.) is included in a target segment.
163
165
164
-
**By default, materializations are managed by Confidence servers.** When sticky assignment data is needed, the provider makes a network call to Confidence, which maintains the sticky repository server-side with automatic 90-day TTL management. This requires no additional setup.
166
+
### Materialization Storage Options
165
167
166
-
### Custom Materialization Storage
168
+
The provider offers three options for managing materialization data:
167
169
168
-
Optionally, you can implement a custom `MaterializationStore` to manage materialization data in your own storage (Redis, database, etc.) to eliminate network calls and improve latency:
170
+
#### 1. No Materialization Support (Default)
171
+
172
+
By default, materializations are not supported. If a flag requires materialization data (sticky assignments or custom targeting), the evaluation will fail and return the default value.
Enable remote materialization storage to have Confidence manage materialization data server-side. When sticky assignment data or materialized segment targeting data is needed, the provider makes a gRPC call to Confidence:
**⚠️ Important Performance Impact**: This option fundamentally changes how the provider operates:
195
+
-**Without materialization (default)**: Flag evaluation requires **zero network calls** - all evaluations happen locally with minimal latency
196
+
-**With remote materialization**: Flag evaluation **requires network calls** to Confidence for materialization reads/writes, adding latency to each evaluation
197
+
198
+
This option:
199
+
- Requires network calls for materialization reads/writes during flag evaluation
200
+
- Automatically handles TTL and cleanup
201
+
- Requires no additional infrastructure
202
+
- Suitable for production use cases where sticky assignments or materialized segment targeting are required
203
+
204
+
#### 3. Custom Materialization Storage
205
+
206
+
For advanced use cases requiring minimal latency, implement a custom `MaterializationStore` to manage materialization data in your own infrastructure (Redis, database, etc.):
169
207
170
208
```java
171
-
//Optional: Custom storage for materialization data
209
+
// Custom storage for materialization data
172
210
MaterializationStore store =newRedisMaterializationStore(jedisPool);
0 commit comments