The user wants a "faceted nav quarantine" system design.
Key components mentioned:
- New facet intake: How to propose and add new navigation facets.
- Budget impact tests: How to ensure the new facets don't degrade performance (latency, cost).
- Rollout approvals: The governance/gating process.
Goal: Create a structured system (quarantine) that prevents "facet bloat" and ensures only high-value, performant facets reach production.
Target Audience: Likely engineers, product managers, or data architects working on search/discovery platforms (e.g., e-commerce, library systems).
Structure of the response:
- Concept Overview: Define what the "Quarantine" is. It's a staging/validation environment.
- Phase 1: Intake (The "Waiting Room"): The proposal process.
- Mechanism: Metadata collection (Source, Cardinality, Type).
- Stakeholders: Who requests it? (PMs, Merchants).
- Phase 2: Quarantine (The "Testing Lab"): This is the core technical implementation.
- Environment: Shadow traffic or a staging index.
- Budget Impact Tests:
- Latency: P95/P99 impact.
- Index Size: Storage costs.
- Cardinality: "Budget" often implies a limit on unique values (high cardinality breaks UI/UX and performance).
- Relevance: Does it actually help users? (CTR, Conversion).
- Phase 3: Approval (The "Gate"): Governance.
- Criteria: Pass/Fail rubric.
- Approvers: Tech Lead, Performance Engineer.
- Phase 4: Rollout Strategy: Gradual release.
- Feature Flags: Dark launch -> Canary -> GA.
- Architecture Diagram (Mental Draft -> Text representation):
- Request -> Config Service -> Quarantine Index -> Benchmarking Suite -> Approval Gate -> Prod Config.
- Key Metrics: "Budget" definition.
Refining the "Budget" concept:
The user specifically mentioned "budget impact tests." In the context of faceted navigation, "budget" usually refers to:
- Performance Budget: Latency (ms), CPU cycles.
- Memory Budget: Heap usage, Index size.
- Correction: Sometimes "budget" means financial cost, but usually in search engineering, it means "Performance Budget." I will address both (Cloud costs vs. Latency).
Refining the "Quarantine" concept:
A quarantine implies isolation. New facets shouldn't touch the live index until vetted.
- Technique: Shadow Indexing. Copy a slice of traffic, apply the new facet schema, measure the overhead.
Drafting the Steps:
- Step 1: Intake Request. Needs a template. "What is the facet?" "Why do we need it?" "Expected distinct values?"
- Step 2: Automated Budget Testing.
- Cardinality Check: If > 1000 values, auto-fail or require hierarchical drill-down.
- Latency Injection: Simulate the query with the extra facet calculation.
- Payload Size: Does the JSON response bloat?
- Step 3: Human Approval.
- Step 4: Canary Release.
Adding Polish:
Use professional terminology (Cardinality, Skew, P95, Shadow Traffic). Structure it like a technical design document (TDD) or an RFC.
Self-Correction during drafting:
Initial thought: Just check if it's slow.
Correction: High cardinality facets (like user_id) are dangerous for UI rendering, not just backend speed. I need to emphasize Client-side budget as well.
Initial thought: "Budget" means money.
Correction: While relevant, usually "budget impact" in this context refers to "Performance Budget" (latency/throughput). I will clarify this distinction.
Final Structure Plan:
- High-Level Architecture: The "Facet Sandbox."
- Stage 1: Intake & Classification: The form and the rules.
- Stage 2: The Quarantine Engine (Budget Impact): The technical tests (Shadow Traffic, Cardinality checks).
- Stage 3: Governance & Rollout: The approval matrix.
- Operational Rules: "The Constitution of Facets."
Let's write it out.
- Intro: Define the problem (Facet rot).
- Intake: JIRA/Form.
- Testing: "Shadow Mode."
- Test A: Cardinality Budget.
- Test B: Latency Budget.
- Test C: Relevance Budget (Revenue).
- Rollout: Gating.
(Self-Correction): Make sure to explicitly mention how the test is done. A "Diff Test" is useful. Run query Q with old facets, run query Q with new facet. Diff the time.
Let's produce the design.
This design outlines a Facet Quarantine System. Its purpose is to prevent "facet rot"—where well-intentioned new filters break search performance, clutter the UI, or confuse users.
This system acts as a staging layer (sandbox) where new facets must prove they are performant and valuable before they are exposed to the general public.
1. Architecture Overview
We will implement a Shadow Traffic / Sandbox Environment. Instead of deploying facets directly to Production, new facets are deployed to a "Quarantine" index. Live user queries are mirrored to this quarantine environment to test performance, but the results are discarded (or logged for analysis) and never shown to the actual user.
2. Phase 1: New Facet Intake (The "Airlock")
This is the request and metadata standardization phase. We enforce strict schema validation before code is even written.
Intake Fields:
- Facet ID & Display Name: e.g.,
is_vegan (ID) vs "Dietary Suitability" (Display).
- Data Type: Boolean, String, Integer Range, Date.
- Cardinality Estimate: Expected unique values (Low < 20, Medium < 100, High > 1000).
- Auto-Reject Rule: If Cardinality > 1000 and not hierarchical, auto-reject (search performance risk).
- Source Mapping: Where does the data come from? (SQL table, API, hardcoded list).
- Business Justification: Which vertical? Expected conversion lift?
Process:
- Submission: Product Manager fills out the Facet Request Form (Jira/ServiceNow).
- Static Analysis: Automated script checks if the field exists in the product catalog feed. If the field is empty for >90% of SKUs, the request is flagged for "Low Coverage Warning."
3. Phase 2: Budget Impact Tests (The "Stress Lab")
Once the facet is built and deployed to the Quarantine environment, it undergoes automated stress testing against a copy of live traffic.
A. Latency Budget (Performance)
We define strict latency SLOs (Service Level Objectives).
- Test: Replay the last 24 hours of peak traffic (e.g., Black Friday traffic volume) against the Quarantine index.
- Metric:
p95_query_latency_with_new_facet.
- Threshold:
- Total Search Page Load must increase by < 50ms.
- Facet Aggregation time must be < 20ms.
- Failure State: If the facet adds >10% overhead to query latency, it is rejected or forced into "Lazy Load" mode (only load via AJAX after initial render).
B. Indexing Budget (Storage & Cost)
Facets increase the size of the search index (memory/disk usage).
- Test: Re-index the full product catalog with the new field enabled.
- Metric: Index size growth percentage.
- Threshold: Index size growth must be < 5%.
- Failure State: If a facet is "bloated" (e.g., storing massive text blobs), it is rejected until the data is normalized or hashed.
C. UI Real Estate Budget (UX)
- Test: Automated screenshot comparison (BackstopJS) on mobile and desktop.
- Metric: "Fold Depth."
- Threshold: The new facet must not push the "Price" or "Brand" facets below the fold on a 13" laptop screen.
- Failure State: Requires "Show More" truncation or demotion to a "See All Filters" modal.
4. Phase 3: Rollout Approvals (The "Gating")
This phase uses a "Canary Release" strategy. The facet is deployed to production infrastructure but hidden behind a Feature Flag.
Approval Workflow
- Automated QA Sign-off:
- Unit tests pass.
- No regression in other filter logic (e.g., selecting "Blue" and "Vegan" doesn't return Red Meat).
- Performance Engineer Sign-off:
- Verifies the Stress Test report from Phase 2.
- Checks cloud billing impact (e.g., does this require scaling up the cluster?).
- Product Owner Sign-off:
- Verifies copy and business logic.
Graduated Rollout (The "Canary")
Instead of 100% launch, we use a tiered rollout based on the Budget Impact results.
- Tier 1 (Internal Dogfood - 1%): Enabled only for internal IP addresses. Manual verification.
- Tier 2 (Shadow Mode - 10%): Enabled for 10% of users.
- Metric: Facet Interaction Rate (How many people click it?).
- Metric: Zero Result Rate (Does this facet lead users to dead ends?).
- Tier 3 (General Availability - 100%):
- If Interaction Rate > 2% and Latency < Threshold: Full rollout.
- If Interaction Rate < 0.5%: Auto-Sunset Triggered (Facet is removed automatically after 30 days of low usage).
5. Dashboard & Monitoring
To maintain this system, you need a "Facet Health Dashboard" visible to the Search Team.
- Quarantine Queue: List of facets currently in testing.
- Top Performers: Facets with highest click-through rates.
- The Zombie List: Facets that passed the intake but are rarely used by customers (Candidates for deletion to save index budget).
- Latency Heatmap: Real-time view of query lag attributed to specific facets.
Summary of Governance
| Status | Requirement | Action |
|---|
| Draft | Schema defined | Awaiting data ingestion |
| Quarantine | Data ingested | Undergoing Budget/Perf testing |
| Approved | Tests passed | Ready for Feature Flag release |
| Active | Live on site | Monitored for usage (Zombie check) |
| Retired | Low usage / High cost | Removed from index |