인터페이스는 현지화되어 있으며, Skill 소개와 설명 문서는 선택한 언어로 AI가 자동 번역합니다. 코드·명령어·경로·전문 용어는 원문을 유지하며 원작자 문서가 우선합니다.
Skills 둘러보기
데이터 및 연구 · SKILL.md

django-recommender-search-backend-patterns

django-recommender-search-backend-patterns

Django backend patterns for recommendation services (AWS Personalize, Databricks Model Serving, internal microservices) and OpenSearch-backed search/feed endpoints. Covers fan-out orchestration (asyncio.gather, deadline propagation, partial results, async client reuse), external service protection (timeouts, circuit breakers, jittered retry, bulkheads, rate…

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill 문서

GitHub

name: django-recommender-search-backend-patterns description: Django backend patterns for recommendation services (AWS Personalize, Databricks Model Serving, internal microservices) and OpenSearch-backed search/feed endpoints. Covers fan-out orchestration (asyncio.gather, deadline propagation, partial results, async client reuse), external service protection (timeouts, circuit breakers, jittered retry, bulkheads, rate limits), OpenSearch query patterns (search_after, _source filtering, function_score, aliases, routing, bool.filter), result blending (score normalization, MMR, dedup, cold-start), Redis caching (stampede protection, model-versioned keys, two-tier, negative), resilience (partial-response envelope, stale-on-error, graceful degradation), async (sync_to_async, async ORM, uvicorn, contextvars, disconnect cancellation), and DRF response shape (cursor pagination, ETag, throttling). Use when building, reviewing, or refactoring such a Django backend. Triggers even without explicit "scale" cues. Includes 5 scaffolding templates.

Experimental Django Recommender + Search Backend Best Practices

Implementation patterns for a Django backend serving mixed-results recommendations (Personalize / Databricks / microservice fan-out) and OpenSearch-backed search/feeds. 48 rules across 8 categories, ordered by execution lifecycle impact — earlier categories cascade through everything downstream.

This is the backend peer of the react-fetch-cache-patterns skill. React handles client-side waterfalls and caching; this skill handles server-side fan-out, downstream protection, OpenSearch query design, and ML-blend orchestration.

When to Apply

  • Building or reviewing Django views that fan out to AWS Personalize, Databricks Model Serving, internal microservices, or any ML inference downstream
  • Designing OpenSearch query endpoints (search results, infinite feeds, faceted search)
  • Implementing a recommendations endpoint that blends multiple ranker outputs
  • Investigating "Django backend slow when downstream is degraded" or "Personalize quota exhausted"
  • Adding caching, retry, circuit breakers, or rate limiting to outbound calls
  • Choosing between sync and async Django views, configuring uvicorn vs gunicorn
  • Designing DRF response shapes for paginated feeds, partial results, or degraded paths

Rule Categories by Priority

#CategoryImpactPrefixRules
1Fan-out OrchestrationCRITICALorch-8
2External Service ProtectionCRITICALprotect-7
3OpenSearch Query PatternsCRITICALsearch-8
4Result Blending & PersonalizationHIGHblend-5
5Caching StrategyHIGHcache-5
6Resilience & Partial ResultsHIGHresilience-5
7Async & ConcurrencyMEDIUM-HIGHasync-5
8API Response DesignMEDIUMapi-5

Quick Reference

1. Fan-out Orchestration (CRITICAL)

2. External Service Protection (CRITICAL)

3. OpenSearch Query Patterns (CRITICAL)

4. Result Blending & Personalization (HIGH)

5. Caching Strategy (HIGH)

6. Resilience & Partial Results (HIGH)

7. Async & Concurrency (MEDIUM-HIGH)

8. API Response Design (MEDIUM)

How to Use

  1. Open references/_sections.md for category definitions and impact rationale
  2. Read individual rule files for incorrect-vs-correct code examples (each ~150-300 lines with Python code)
  3. For ready-to-use scaffolds, see scaffolding templates
  4. The AGENTS.md navigation document (auto-generated) provides a TOC for browsing

Scaffolding Templates

Five ready-to-adapt Python templates under assets/templates/:

TemplatePurpose
fanout_recommender_service.py.templateAsync fan-out client to Personalize/Databricks/microservice with per-downstream circuit breaker, bounded timeout, partial-result return
opensearch_search_view.py.templateDRF view + OpenSearch search_after cursor + function_score blending + _source filtering
result_blender.py.templateScore normalization + MMR diversity + canonical-ID dedup + cold-start fallback
redis_cache_with_stampede.py.templateStampede-safe cached function decorator with SETNX lock and jittered TTL
degraded_response.py.templatePartial-results envelope with per-source status flags + tier-based fallback

Reference Files

FileDescription
references/_sections.mdCategory definitions, ordering, impact rationale, tier definitions
assets/templates/_template.mdTemplate for authoring new rules
metadata.jsonVersion, references, abstract

Related Skills

  • react-fetch-cache-patterns — Client-side peer covering React data fetching/caching (Suspense, query libraries, prefetch)
  • io-bound-data-processing — Python async patterns for batch and pipeline workloads
  • inngest-nextjs-patterns — Workflow patterns for server-side step functions
저장한 Skills