Skip to content

Commit eac5128

Browse files
committed
chore: added a 'shadowing' section
1 parent 43d8d16 commit eac5128

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/content/best-practices/adoption-patterns.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,26 @@ Some companies decide to wrap <ProductName format={ProductNameFormat.ShortForm}/
168168

169169
On the other hand, adding another service increases latency and adds additional complexity.
170170

171+
## Shadowing the <ProductName format={ProductNameFormat.ShortForm}/> API
172+
173+
When migrating from an existing authorization system to <ProductName format={ProductNameFormat.ShortForm}/>, it's recommended to first run both systems in parallel, with <ProductName format={ProductNameFormat.ShortForm}/> in "shadow mode". This means that while the existing system continues to make the actual authorization decisions, you also make calls to <ProductName format={ProductNameFormat.ShortForm}/> asynchornously and compare the results.
174+
175+
This approach has several benefits:
176+
177+
- You can validate that your authorization model and relationship tuples are correctly configured before switching to <ProductName format={ProductNameFormat.ShortForm}/>.
178+
- You can measure the performance impact of adding <ProductName format={ProductNameFormat.ShortForm}/> calls to your application.
179+
- You can identify edge cases where the <ProductName format={ProductNameFormat.ShortForm}/> results differ from your existing system.
180+
- You can gradually build confidence in the <ProductName format={ProductNameFormat.ShortForm}/> implementation.
181+
182+
To implement shadow mode:
183+
184+
1. Configure your application to make authorization checks against both systems
185+
2. Log any discrepancies between the two systems
186+
3. Analyze the logs to identify and fix any issues
187+
4. Once confident in the results, switch to using <ProductName format={ProductNameFormat.ShortForm}/> as the source of truth
188+
189+
This pattern is particularly useful for critical systems where authorization errors could have significant impact.
190+
171191
## Related Sections
172192

173193
<RelatedSection

0 commit comments

Comments
 (0)