- Home
- Skills
- Data & Databases
- Database Sharding Topology Planner
Works with the AI Agents you already use
Database Sharding Topology Planner
Design horizontal sharding architectures, partition keys, and query routing layers for high-scale databases.
$15
Database Sharding Topology Planner
Example session with this skill installed
I need a sharding plan for a global e-commerce platform using PostgreSQL. We have 50TB of order data and frequent 'hot spots' on flash sale days. Help me pick a key and routing strategy.
- Read your context and instructions
- Compiled the database sharding topology
I have analyzed your workload requirements for the global e-commerce platform. Given the flash sale volatility and 50TB volume, a hash-based sharding strategy is recommended to distribute write pressure uniformly.
Horizontal Sharding Topology Plan: E-commerce Orders
| Component | Specification |
|---|---|
| Shard Key | hash(user_id) |
| Partition Strategy | Consistent Hashing (to minimize remapping during shard additions) |
| Co-location Logic | Co-locate order_items and shipping_details with orders via user_id |
| Routing Layer | Sidecar-based Query Coordinator (e.g., Vitess-style VTGate or custom proxy) |
| Hot Spot Mitigation | Virtual nodes mapping to physical shards to balance high-traffic users |
Routing Algorithm Logic
-- Logical routing flow for the Query Coordinator
-- 1. Extract user_id from query predicate
-- 2. Calculate hash: target_shard = md5(user_id) % total_virtual_nodes
-- 3. Map virtual node to physical IP via internal lookup table
-- 4. Forward query to specific shard; return result to application
Shard Splitting & Rebalancing Strategy
- Threshold Monitoring: Trigger split when a physical shard reaches 80% of 2TB capacity.
- Logical Grouping: Use 1024 virtual buckets mapped to 16 initial physical shards.
Live Migration: Copy data to new shard in background, tail the WAL for delta sync, and flip the routing table pointer during a low-traffic window.
Next steps
- Review the
user_iddistribution in your current dataset to ensure high entropy. - Select a routing proxy (e.g., Vitess for MySQL or Citus for Postgres) to implement the coordinator layer.
- Define the
virtual_nodemapping table in your configuration management system.
Connects securely to your tools. The creator never sees your data.
About this skill
Scaling a database beyond a single node introduces immediate complexity in data distribution and query routing. This skill provides a structured framework for designing horizontal sharding architectures that maintain performance while eliminating cross-shard bottlenecks.
What it does
- Shard Key Selection identifies the optimal hash, range, or directory-based partitioning strategy for your specific data access patterns.
- Data Co-location designs schemas that group related entities on the same physical nodes to prevent expensive cross-shard joins.
- Routing Layer Architecture defines the query coordinator logic to ensure requests hit the correct shard with minimal latency.
- Migration Planning formulates shard splitting procedures and live data migration paths that avoid system downtime.
How it works
- Analyze workload to determine if hash-based, range-based, or directory-based sharding is appropriate for your traffic.
- Define entity relationships to map how related records should be co-located to maintain relational integrity without distributed transactions.
- Map the routing logic by designing the coordinator layer that handles shard discovery and query distribution.
- Draft the rebalancing strategy for future growth, outlining how shards will split and migrate as data volume increases.
Frameworks & tools
This skill is platform-agnostic and applies to high-scale RDBMS like PostgreSQL and MySQL, as well as NoSQL systems. It focuses on the architectural logic required for distributed environments.
Why this beats prompting it yourself
Manual prompts often result in generic advice that ignores the critical "hot spot" problem or cross-shard join overhead. This skill uses a deterministic workflow to ensure the routing layer and shard key selection are mathematically and logically sound for petabyte-scale growth.
Use cases
- Designing a sharding strategy for a multi-tenant SaaS with uneven data growth.
- Migrating a monolithic PostgreSQL instance to a horizontally scaled cluster.
- Implementing a custom shard routing layer for a high-throughput microservice.
- Planning a non-disruptive shard split for a rapidly expanding time-series database.
Known limitations
This skill focuses on architectural design and topology planning rather than providing automated scripts for physical infrastructure provisioning or cloud-specific managed service configurations.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.
Focuses on architectural blueprints and routing logic. Does not provide infrastructure-as-code scripts or automated database migration execution tools.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 3 days ago
- Software
- Zero global installationorelevated privileges required.
File System Read/Write (strictly scoped to current project workspace `./`).
Permissions
Target Use Cases: - Design a horizontal sharding architecture for PostgreSQL. - Select shard key for multi-tenant database scaling. - Plan zero-downtime shard rebalancing and routing strategy.