Guide · Amazon Keyspaces · Capacity Management · MCP Server Operations
Amazon Keyspaces Capacity Modes and Operations for MCP Servers
Amazon Keyspaces offers two throughput modes — on-demand (pay-per-request) and provisioned (reserved RCU/WCU) — with fundamentally different cost profiles that suit different MCP server workload shapes. On top of throughput, Keyspaces provides operational features that matter for production MCP deployments: point-in-time recovery (PITR) for restoring to any second in the last 35 days, on-demand backups for snapshots before migrations, CloudWatch metrics for capacity planning, and IAM resource policies for multi-team access control. This guide covers how to choose the right mode, how to switch between them, how to monitor and alert on capacity usage, and how to operate PITR and backups.
TL;DR
Use on-demand (PAY_PER_REQUEST) for MCP servers in development, variable-traffic production, or when you cannot predict peak throughput — it is 2–5x more expensive per read/write than provisioned at sustained load but requires zero capacity planning. Use provisioned (PROVISIONED) for steady-traffic MCP tools once you know the RCU/WCU floor from CloudWatch metrics. Enable PITR from day one — it costs ~20% of your table storage. You can switch between modes at most once every 30 seconds per table (rate-limit enforced). CloudWatch metric ConsumedReadCapacityUnits and ConsumedWriteCapacityUnits tell you actual throughput; use them to set provisioned targets or trigger auto-scaling policies.
On-demand vs provisioned — when to use each
| Characteristic | On-demand (PAY_PER_REQUEST) | Provisioned |
|---|---|---|
| Cost model | Per-read + per-write; no idle cost beyond storage | Reserved RCU/WCU per second, billed whether used or not |
| Burst capacity | Instant — absorbs any load up to service limits | Up to 2x provisioned capacity briefly (burst); throttled beyond that |
| Cost at sustained high throughput | 2–5x more expensive than equivalent provisioned capacity | Predictable; cheapest at high utilization (≥60%) |
| Cost at low utilization | Cheap — only pay for actual reads/writes | Wasteful — paying for unused reserved capacity |
| Capacity planning required | No | Yes — set based on P99 throughput from CloudWatch |
| Throttling behavior | No throttling (up to service quotas) | Throttled when exceeding provisioned + burst capacity |
| Right for MCP servers | Dev/test; variable-traffic agents; event-driven tools | Steady-traffic production tools with predictable load |
Start on-demand. After 2 weeks of production traffic, check CloudWatch for the P95 and P99 of ConsumedReadCapacityUnits and ConsumedWriteCapacityUnits. If utilization is steady (variance < 3x between P50 and P99), switch to provisioned at 1.2x the P99 value.
Setting capacity mode at table creation
import { CreateTableCommand, ThroughputMode } from '@aws-sdk/client-keyspaces';
// On-demand: PAY_PER_REQUEST
await ksClient.send(new CreateTableCommand({
keyspaceName: 'mcp_server',
tableName: 'tool_invocations',
schemaDefinition: { /* ... */ },
capacitySpecification: {
throughputMode: ThroughputMode.PAY_PER_REQUEST,
},
}));
// Provisioned: explicit RCU/WCU
await ksClient.send(new CreateTableCommand({
keyspaceName: 'mcp_server',
tableName: 'tool_invocations_prod',
schemaDefinition: { /* ... */ },
capacitySpecification: {
throughputMode: ThroughputMode.PROVISIONED,
readCapacityUnits: 100, // RCU: one strongly-consistent 4KB read per second
writeCapacityUnits: 50, // WCU: one 1KB write per second
},
}));
Capacity units for Keyspaces:
- Read Capacity Unit (RCU): One LOCAL_QUORUM read of a row up to 4 KB. Rows larger than 4 KB consume additional RCUs (ceil(rowSize / 4096)). LOCAL_ONE reads consume 0.5 RCU each.
- Write Capacity Unit (WCU): One write of a row up to 1 KB. Rows larger than 1 KB consume additional WCUs (ceil(rowSize / 1024)).
- Lightweight transaction (LWT):
IF NOT EXISTSand conditional updates consume 4 WCUs per write (not 1). Use sparingly.
Switching capacity modes and updating provisioned capacity
Use UpdateTableCommand to change capacity mode or adjust provisioned throughput. Switching modes is rate-limited to one change per table every 30 seconds and one mode switch per table per day (not unlimited):
import { UpdateTableCommand, ThroughputMode } from '@aws-sdk/client-keyspaces';
// Switch from on-demand to provisioned
await ksClient.send(new UpdateTableCommand({
keyspaceName: 'mcp_server',
tableName: 'tool_invocations',
capacitySpecification: {
throughputMode: ThroughputMode.PROVISIONED,
readCapacityUnits: 150,
writeCapacityUnits: 75,
},
}));
// Update provisioned throughput (without changing mode)
await ksClient.send(new UpdateTableCommand({
keyspaceName: 'mcp_server',
tableName: 'tool_invocations',
capacitySpecification: {
throughputMode: ThroughputMode.PROVISIONED,
readCapacityUnits: 300, // scale up for a known spike (pre-announcement traffic)
writeCapacityUnits: 150,
},
}));
Switch back to on-demand before high-uncertainty traffic events (product launches, MCP tool announcements), then switch to provisioned after steady-state metrics establish themselves.
CloudWatch metrics for capacity monitoring
Keyspaces publishes the following CloudWatch metrics under the AWS/Cassandra namespace. Use these to right-size provisioned capacity and set alarms before throttling impacts MCP tool users.
| Metric | What it measures | Use for |
|---|---|---|
ConsumedReadCapacityUnits | RCU consumed per second (sum) | Setting provisioned RCU target; detecting read spikes |
ConsumedWriteCapacityUnits | WCU consumed per second (sum) | Setting provisioned WCU target; detecting write spikes |
ProvisionedReadCapacityUnits | RCU currently provisioned | Verifying UpdateTableCommand applied |
ProvisionedWriteCapacityUnits | WCU currently provisioned | Verifying UpdateTableCommand applied |
ReadThrottleEvents | Read requests throttled due to exceeding provisioned RCU | Alert when > 0 sustained for > 1 minute — indicates under-provisioning |
WriteThrottleEvents | Write requests throttled due to exceeding provisioned WCU | Alert when > 0 sustained for > 1 minute |
UserErrors | CQL errors (invalid query, type mismatch, etc.) | Alert on sustained non-zero — indicates driver or schema bugs |
SystemErrors | Service-side errors | Alert on any non-zero — indicates Keyspaces service issues |
BillableTableSizeInBytes | Billed storage bytes for the table | Monitor growth; set billing alarm |
Create alarms via CDK or CloudFormation:
// CloudFormation resource for a throttle alarm
{
"Type": "AWS::CloudWatch::Alarm",
"Properties": {
"AlarmName": "keyspaces-write-throttle-mcp-prod",
"Namespace": "AWS/Cassandra",
"MetricName": "WriteThrottleEvents",
"Dimensions": [
{ "Name": "Keyspace", "Value": "mcp_server" },
{ "Name": "TableName", "Value": "tool_invocations" }
],
"Statistic": "Sum",
"Period": 60,
"EvaluationPeriods": 2,
"Threshold": 1,
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"AlarmActions": ["arn:aws:sns:us-east-1:123456789012:ops-alerts"],
"TreatMissingData": "notBreaching"
}
}
Point-in-time recovery (PITR)
PITR continuously backs up your Keyspaces table, allowing restore to any second within the last 35 days. It is the primary recovery mechanism for accidental data deletion, bad deployments, and data corruption from MCP tool bugs.
import {
UpdateTableCommand,
RestoreTableToPointInTimeCommand,
GetTableCommand,
} from '@aws-sdk/client-keyspaces';
// Enable PITR on an existing table
await ksClient.send(new UpdateTableCommand({
keyspaceName: 'mcp_server',
tableName: 'tool_invocations',
pointInTimeRecovery: { status: 'ENABLED' },
}));
// Restore to a specific point in time (creates a new table)
await ksClient.send(new RestoreTableToPointInTimeCommand({
sourceKeyspaceName: 'mcp_server',
sourceTableName: 'tool_invocations',
targetKeyspaceName: 'mcp_server',
targetTableName: 'tool_invocations_restored_20261113',
restoreTimestamp: new Date('2026-11-13T08:00:00Z'), // must be within last 35 days
pointInTimeRecovery: { status: 'ENABLED' },
capacitySpecificationOverride: {
throughputMode: 'PAY_PER_REQUEST', // start on on-demand while verifying restore
},
}));
// Poll until restored table is ACTIVE
await waitForTable('mcp_server', 'tool_invocations_restored_20261113');
Important PITR operational notes:
- PITR creates a new table — it does not restore in-place. Plan your table swap procedure: verify the restored table, rename or redirect reads/writes to the restored table, drop the corrupted original.
- PITR costs approximately 20% of billed storage per month. For a 100 GB table: storage is ~$25/month; PITR adds ~$5/month.
- You can restore to the
latestRestorableTime(usually within a few seconds of now) — this is the disaster recovery path for accidentally deleted tables. - PITR does not capture secondary indexes (SAI) — rebuild them on the restored table with
CREATE INDEXafter restore. - Default TTL and capacity specification are preserved from the source table unless you override them in the restore command.
// Find the latest restorable timestamp for a table
const { table } = await ksClient.send(new GetTableCommand({
keyspaceName: 'mcp_server',
tableName: 'tool_invocations',
}));
const latestRestore = table?.pointInTimeRecovery?.latestRestorableTimestamp;
console.log(`Can restore up to: ${latestRestore?.toISOString()}`);
On-demand backups — snapshots before migrations
On-demand backups are table snapshots taken immediately, retained indefinitely until deleted. Use them before schema changes, MCP server deploys that modify data, and data migrations.
import {
CreateBackupCommand,
ListBackupsCommand,
RestoreTableFromBackupCommand,
DeleteBackupCommand,
} from '@aws-sdk/client-keyspaces';
// Create a backup before a migration
const { backupSummary } = await ksClient.send(new CreateBackupCommand({
keyspaceName: 'mcp_server',
tableName: 'tool_invocations',
backupName: 'pre-schema-migration-20261113',
tags: [{ key: 'created-by', value: 'mcp-deploy-script' }],
}));
const backupArn = backupSummary?.backupArn;
// List all backups for a table
const { backups } = await ksClient.send(new ListBackupsCommand({
keyspaceName: 'mcp_server',
tableName: 'tool_invocations',
}));
// Restore from an on-demand backup (creates a new table)
await ksClient.send(new RestoreTableFromBackupCommand({
targetKeyspaceName: 'mcp_server',
targetTableName: 'tool_invocations_from_backup',
backupArn: backupArn!,
}));
// Delete backup when no longer needed (backups are billed at ~$0.10/GB/month)
await ksClient.send(new DeleteBackupCommand({ backupArn: backupArn! }));
IAM policies for Keyspaces operations
Keyspaces IAM uses resource ARNs of the form arn:aws:cassandra:REGION:ACCOUNT:/keyspace/NAME/table/NAME. Separate management-plane and data-plane permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "KeyspacesManagementReadOnly",
"Effect": "Allow",
"Action": [
"cassandra:Create",
"cassandra:Drop",
"cassandra:Alter",
"cassandra:Restore"
],
"Resource": [
"arn:aws:cassandra:us-east-1:123456789012:/keyspace/mcp_server/*"
]
},
{
"Sid": "KeyspacesDataAccess",
"Effect": "Allow",
"Action": [
"cassandra:Select",
"cassandra:Modify"
],
"Resource": [
"arn:aws:cassandra:us-east-1:123456789012:/keyspace/mcp_server/table/tool_invocations",
"arn:aws:cassandra:us-east-1:123456789012:/keyspace/system*/table/*"
]
},
{
"Sid": "KeyspacesBackupRestore",
"Effect": "Allow",
"Action": [
"cassandra:Create",
"cassandra:Restore",
"cassandra:Drop"
],
"Resource": "arn:aws:cassandra:us-east-1:123456789012:/keyspace/*/table/*/backup/*"
}
]
}
For least-privilege, give MCP tool Lambda functions only cassandra:Select and cassandra:Modify on specific tables. Reserve cassandra:Create, cassandra:Drop, and cassandra:Alter for the deployment/migration IAM role, not the runtime role.
Service quotas and limits
| Limit | Default | Notes |
|---|---|---|
| Max tables per keyspace | 256 | Requestable increase via Service Quotas |
| Max keyspaces per account per region | 256 | Requestable increase |
| Max partition size | 10 GB (soft guideline) | No hard limit; larger partitions slow reads and compaction |
| Max row size | 1 MB | Hard limit — rows exceeding 1 MB are rejected |
| Max columns per table | 225 | Fixed — design wide tables carefully |
| On-demand throughput limit | 40,000 RCU and 40,000 WCU per second per table | Requestable increase; applies to on-demand mode |
| Provisioned throughput limit | 40,000 RCU and 40,000 WCU per second per table | Requestable increase |
| Max backups per table | 35 | Fixed; delete old backups before creating new ones |
| Capacity mode switches per table per day | 4 times per day | Rate-limited — plan mode switches carefully |
For MCP server tools with high read amplification (many tool calls per session each issuing Keyspaces queries), the default 40,000 RCU/second per table is usually not a constraint. If you approach it, consider splitting the table into multiple tables by partition key range, using ElastiCache as a read-through cache layer, or requesting a quota increase.
Cost estimation for MCP server workloads
| Workload type | Approximate monthly cost | Mode recommendation |
|---|---|---|
| Dev/test MCP server (100 req/hour) | <$1/month | On-demand |
| Low-traffic production (1,000 req/hour) | $3–8/month | On-demand |
| Mid-traffic production (10,000 req/hour) | $30–80/month | On-demand → switch to provisioned at ~2 weeks |
| High-traffic production (100,000 req/hour) | $150–$400/month on-demand; $50–$100 provisioned | Provisioned at steady load |
| Storage per GB (per month) | $0.25/GB | Use default_time_to_live to cap data growth |
| PITR overhead | ~$0.20 per GB stored per month additional | Always enable in production |
| On-demand backup storage | $0.10/GB/month | Delete after migration completes |