Cleanse Container
Learn how Cleanse Container runs multiple cleanse steps in memory and saves the combined result to the profile in a single write.
Cleanse Container is a cleanse function that runs several cleanse steps, in order, against an in-memory copy of the entity values. It then saves the combined result to the profile once. Use Cleanse Container when several steps target the same attributes, or when a multi-step sequence must succeed or fail as a whole.
Cleanse Container is opt-in. Cleanse chains that don't use it continue to work unchanged. To go back to your previous behavior, remove Cleanse Container from your cleanse configuration.
For role definitions, see About roles.
How Cleanse Container works
Cleanse Container loads the entity values into an in-memory context and then runs each step in the order that you list the steps. Before it runs a step, Cleanse Container evaluates the filter of the step, if you defined one, against the current in-memory values. If the filter is true or not defined, the step runs and updates the in-memory values. If the filter is false, Cleanse Container skips the step without side effects.
After the last step, Cleanse Container calculates the final results and saves them to the profile in a single write. The write creates or updates one cleanser crosswalk.
Because each step reads and updates the in-memory values, a later step works with the output of earlier steps. Intermediate results are never written to the profile, so earlier outputs aren't overwritten when steps target the same attributes. The same configuration and input always produce the same result.
Failure handling
If any step fails, the whole container fails and Reltio writes nothing to the profile. This includes a step that calls an external cleanser that is unavailable. External cleansers use the platform timeout, retry, and circuit breaker policies. Use a filter to reduce the number of calls to an external cleanser.
Comparison with cleanse chains
The following table compares how a cleanse chain and Cleanse Container process the same sequence of cleanse functions.
| Aspect | Cleanse chain | Cleanse Container |
|---|---|---|
| Where steps run | Each function runs and its result is written before the next function runs | All steps run in memory |
| Profile writes | After each function | Once, after the last step |
| Cleanser crosswalk updates | Multiple | One |
| Overwrite of earlier results when steps target the same attributes | Possible | Eliminated |
| Availability | Default behavior | Opt-in |
Guidelines for using Cleanse Container
Don't mix write-through cleansers and Cleanse Container for the same target attributes in a single transaction. Mixing them can cause race conditions or ambiguous results.
Use Cleanse Container for complex, multi-step cleanse sequences.
Keep filter expressions simple, and use attribute names that you have already validated.
Use filters to limit calls to external cleansers. For example, run address verification only for the countries you need.
To define a Cleanse Container in your cleanse configuration, see Cleanse Container properties.