Qdrant Sliding Time Window
GitHubOfficialFirst committed by anush008Distributed by GitHub
- Skill
- Tool integration
- Data and AI
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides architectural guidance for managing time-series data in Qdrant, specifically for use cases where only recent data is relevant. It outlines three primary strategies—shard rotation, collection rotation, and filter-and-delete—to help developers balance performance, storage efficiency, and operational complexity. The guide also covers hot/cold tiering for cost-effective storage and common pitfalls to avoid when managing data lifecycles.
What it does
- Explains how to use shard rotation for efficient time-based data management.
- Details collection rotation strategies using aliases for per-period configuration.
- Provides a method for continuous cleanup using filter-and-delete with payload indexing.
- Offers guidance on implementing hot/cold storage tiers for performance optimization.
- Lists critical anti-patterns to avoid during data rotation and deletion.
When to use it
- When you need to expire old vectors based on a time window.
- When building search features for social media feeds, news, or logs.
- When you need to keep only the last N months of data.
- When you need to optimize storage by moving older data to cheaper tiers.
Advantages
- Shard rotation allows for instant resource reclamation without fragmentation.
- Collection rotation supports unique configuration settings per time period.
- Provides clear trade-offs between operational complexity and performance.
- Helps prevent common performance issues like full scans or excessive optimizer locks.
Usage examples
- “How do I keep only the last 30 days of logs in Qdrant?”
- The agent will recommend using shard rotation for daily or weekly intervals, allowing you to delete the oldest shard keys to reclaim resources instantly.
- “What is the best way to handle data rotation for a news feed?”
- The agent will explain the shard rotation strategy as the recommended approach to maintain search performance across time periods without application-level fan-out.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/github/qdrant-sliding-time-window/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip qdrant-sliding-time-window.zip -d .agents/skills
Documentation by anush008
Scaling with a Sliding Time Window
Use when only recent data needs fast search -- social media posts, news articles, support tickets, logs, job listings. Old data either becomes irrelevant or can tolerate slower access.
Three strategies: shard rotation (recommended), collection rotation (when per-period config differs), and filter-and-delete (simplest, for continuous cleanup).
Shard Rotation (Recommended)
Use when: data has natural time boundaries (daily, weekly, monthly). Preferred because queries span all time periods in one request without application-level fan-out. User-defined sharding
Create a collection with user-defined sharding enabled
Create one shard key per time period (e.g.,
2025-01,2025-02, ...,2025-06)Ingest data into the current period's shard key
When a new period starts, create a new shard key and redirect writes
Delete the oldest shard key outside the retention window
Deleting a shard key reclaims all resources instantly (no fragmentation, no optimizer overhead)
Pre-create the next period's shard key before rotation to avoid write disruption
Use
shard_key_selectorat query time to search only specific periods for efficiencyShard keys can be placed on specific nodes for hot/cold tiering
Collection Rotation (Alias Swap)
Use when: you need per-period collection configuration (e.g., different quantization or storage settings). Collection aliases
Create one collection per time period, point a write alias at the newest
Query across all active collections in parallel, merge results client-side
When a new period starts, create the new collection and swap the write alias Switch collection
Drop the oldest collection outside the window
Trade-off vs shard rotation: allows per-collection config differences, but requires application-level fan-out and more operational overhead.
Filter-and-Delete
Use when: data arrives continuously without clear time boundaries, or you want the simplest setup.
Store a
timestamppayload on every point, create a payload index on it Payload indexFilter to the desired window at query time using
rangecondition Range filterPeriodically delete expired points using delete-by-filter Delete points
Run cleanup during off-peak hours in batches (10k-50k points) to avoid optimizer locks
Deletes are not free: tombstoned points degrade search until optimizer compacts segments
Does not reclaim disk instantly (compaction is asynchronous)
Hot/Cold Tiers
Use when: recent data needs fast in-RAM search, older data should remain searchable at lower performance.
Shard rotation: place current shard key on fast-storage nodes, move older shard keys to cheaper nodes via shard placement. All queries still go through a single collection.
Collection rotation: keep current collection in RAM (
always_ram: true), move older collections to mmap/on-disk vectors. Quantization
What NOT to Do
Do not use filter-and-delete for high-volume time-series with millions of daily deletes (use rotation instead)
Do not forget to index the timestamp field (range filters without an index cause full scans)
Do not use collection rotation when shard rotation would suffice (unnecessary fan-out complexity)
Do not drop a shard key or collection before verifying its period is fully outside the retention window
Do not skip pre-creating the next period's shard key or collection (write failures during rotation are hard to recover)
Files
- ATTRIBUTION.mdAdded by AutoGineer913 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md4.4 KiB
Requirements and compatibility
Written for: GitHub Copilot
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- First committed by
anush008
- Publisher
- GitHub (Official)
- Distributed by
- GitHub
- Source
- github/awesome-copilot · skills/qdrant-scaling/scaling-data-volume/sliding-time-window · commit 797337f
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Contributors
- anush008
AutoGineer is not affiliated with or endorsed by anush008 or GitHub.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download qdrant-sliding-time-window.zip